How to use the value of a display file field in RPGLE Program

770 pts.
Tags:
Display File
RPGLE
RPGLE Program
I have a display file. In this display file user is entering a name. So how do I pull this name in the RPGLE program for further use?

Software/Hardware used:
Display File
ASKED: July 5, 2013  4:50 AM
UPDATED: July 5, 2013  12:08 PM

Answer Wiki

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

Discuss This Question: 6  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
  • NeilD
    A display file behaves in much the same way as a database file within the pogram. When the user enters data on screen and presses enter, that data is available within the program for you to do whatever you need.
    420 pointsBadges:
    report
  • TomLiotta
    It's not clear what you are actually asking. Like any record data, to bring the data in, you need to read the record. (The user pressing [Enter] won't do it.) . It might be an actual READ, or it might happen as the input part of EXFMT. There are other ways, but those two are far most common for display files. . Tom
    125,585 pointsBadges:
    report
  • Varun123
    Hi Ankit, Unlike CLP, we don't prefix '&' before any variable. You can use the variable name directly in RPGLE with the same name as that you defined the variable in DSPF. -Var
    190 pointsBadges:
    report
  • TomLiotta
    But using the variable name is not sufficient. Using the variable does not cause the value to be brought from the display into program memory. It only allows you to reference the value after it's been brought in. . Tom
    125,585 pointsBadges:
    report
  • NeilD
    "In this display file user is entering a name" This statement from the OP infers that the user has entered a name and pressed enter. So, based on the fact that the program is now in control the OP can collect the value of the DSPF field. If the OP's knowledge is such that this needs more explanation it would be futile for us to help until they have further training.
    420 pointsBadges:
    report
  • TomLiotta

    If the OP’s knowledge is such that this needs more explanation it would be futile for us to help until they have further training.

    That is most definitely true. It's probably at the very center of the OP's problem.

    So how do I pull this name in the RPGLE program for further use?

    But that is the OP's actual question. The answer is to READ the record. Without a READ, it doesn't matter if a user presses [Enter]. The result might be simply locking the keyboard. The program won't be back in control without a READ in some form regardless of any [Enter] key (though the READ probably won't complete until [Enter] is pressed; it's not required but is probable). The READ is what 'pulls' the value into the program for use.

    Tom

    125,585 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