Position the file cursor in CL
Page 1 of 1
Position the file cursor in CL
Is there any way to position the file cursor to the beginning of the file once the EOF is reached in CL program?
Re: Position the file cursor in CL
There is a work around if you have V5R2 or later version:
Decalre a file twise with diff OPNID:
________________________________________________
PGM
DCLF FILE(*LIBL/DEPT) OPNID(F1)
DCLF FILE(*LIBL/DEPT) OPNID(F2)
F1: RCVF OPNID(F1)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(F2))
SNDMSG MSG(&F1_DESC) TOUSR(MARAN)
GOTO CMDLBL(F1)
F2: RCVF OPNID(F2)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(ENP))
SNDMSG MSG(&F2_DESC) TOUSR(MARAN)
GOTO CMDLBL(F2)
ENP: ENDPGM
Decalre a file twise with diff OPNID:
________________________________________________
PGM
DCLF FILE(*LIBL/DEPT) OPNID(F1)
DCLF FILE(*LIBL/DEPT) OPNID(F2)
F1: RCVF OPNID(F1)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(F2))
SNDMSG MSG(&F1_DESC) TOUSR(MARAN)
GOTO CMDLBL(F1)
F2: RCVF OPNID(F2)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(ENP))
SNDMSG MSG(&F2_DESC) TOUSR(MARAN)
GOTO CMDLBL(F2)
ENP: ENDPGM
Similar topics
» Position the cursor to the particular key
» What are the reasons a logical file may be "dropped" during the File definition load process?
» Define term 'File Type' and list various file types.
» Copy Spool File to PF/Flat file
» Physical File & Logical File
» What are the reasons a logical file may be "dropped" during the File definition load process?
» Define term 'File Type' and list various file types.
» Copy Spool File to PF/Flat file
» Physical File & Logical File
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum