SUBFILE

30 pts.
Tags:
RPGLE
IF I HAVE AN EMPTY DATABASE FILE WITH NO RECORDS. HOW WILL I CODE IN RPGLE WITHOUT LETTING THE PROGRAM CRASH?

Software/Hardware used:
AS400

Answer Wiki

Thanks. We'll let you know when a new response is added.

Set off the SFLDSP indicator and seton the SFLDSPCTL indicator

Discuss This Question: 7  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • philpl1jb
    Or you could create 1 subfile record with the message "No Records exist" in the first text field. Phil
    51,355 pointsBadges:
    report
  • pdsathishkumar
    set indicator in subfile display, subfile display control.. eval *in35=*on -> ON subfile display control indicator exfmt subctl -> subfile control record format name and switch off subfile display and subfile display control indicator after you getting empty subfile....
    3,790 pointsBadges:
    report
  • HOPPER5089
    thanx every1.deepu and sathish that exactly is the answer i was looking for.
    30 pointsBadges:
    report
  • HOPPER5089
    what exactly is the scenario if we use MONMSG to capture the error. is it possible??
    30 pointsBadges:
    report
  • deepu9321
    You cannot have the MONMSG Command in RPGLE. Why would you like to use MONMSG, Main use of having MONMSG is for error handling. You can follow the above suggested procedure for avoiding the Program Crash. If Records > 0 ; Switch Display & Display Control Indicators Else Switch Display Control Indicator Only EndIF Write Control Format Pradeep.
    4,290 pointsBadges:
    report
  • philpl1jb
    use MONMSG to capture the error. is it possible?? Possible, yes (monitor message is a CL process but there are RPG ways to capture errors/exceptions) that might work in this case, however, these seem totally inappropriate. The program has to compute the subfile RRN to write subfile records so it a staight forward process to use Pradeep recommendion. Pradeep's recommendation it is the standard practice for handling this case. Phil
    51,355 pointsBadges:
    report
  • Supriyoas400
    Firstly.. during CLRSFL : eval dspctl = *off eval clear = *on write sflctl eval dspctl =*on eval clear = *off after reading PF: Only switch on SFLDSP if RRN > 0 in else do as Philpl1jb suggested .
    180 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following