Dynamically declaring files in RPGLE

0 pts.
Tags:
Application development
I want to declare files in rpgle depending on the user choice entered from a display screen Is it possible to dynamically declare files.
ASKED: April 13, 2006  6:00 AM
UPDATED: April 14, 2006  9:49 AM

Answer Wiki

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

Yes, it is possible. You should use SQL for your files which can be determined at run time.

Discuss This Question: 2  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
  • PaulCHsu
    Use program define file. Use 'QCMDEXC' to override the file to user input. Define the record to the possible longest length. ********************************************** FINPUT IF F 500 DISK USROPN ********************************************** D DS D CLP 1 45 D DIM(1) CTDATA PERRCD(1) D FNM 14 45 ********************************************** IINPUT AA 98 I 1 500 REC I 1 52 DSP ********************************************** C *ENTRY PLIST C PARM LIB 10 C PARM FILE 10 C PARM MBR 10 C PARM MBR 10 C EVAL FNM=%TRIM(LIB) + '/' + %TRIM(FILE) C EVAL FNM=FNM + ' ' + MBR C CALL 'QCMDEXC' C PARM CLP(1) C PARM 45 LEN 15 5 C OPEN INPUT C READ INPUT 0101 C DSP DSPLY C CLOSE INPUT C EVAL *INLR='1'
    0 pointsBadges:
    report
  • MTharp
    You could make use of the EXTFILE keyword of file INPUT. A variable (calculated at run-time) is be used to control which file is opened. Also, if a file is multi-member, you can utilize the EXTMBR keyword. FInput if e Disk ExtFile(fnm) UsrOpn D EntryParms pr ExtPgm('PGM1') D 10a D 10a D EntryParms pi D iLib 10a D iFile 10a D fnm s 21a Inz(*blanks) /free if iLib *blanks ; fnm = %trim(iLib) + '/' + %trim(iFile) ; else ; fnm = %trim(Ifile) ; endif ; open Input ; /end-free
    0 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