PaulCHsu
0 pts. | Apr 13 2006 11:46AM GMT
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′
MTharp
0 pts. | Apr 14 2006 9:49AM GMT
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






