PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).

Join the forum, it's quick and easy

PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).
PMS Information Systems
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Position the file cursor in CL

Go down

Position the file cursor in CL Empty Position the file cursor in CL

Post  maran Mon Jul 27, 2009 8:00 pm

Is there any way to position the file cursor to the beginning of the file once the EOF is reached in CL program?
maran
maran
Admin

Posts : 442
Join date : 2009-07-24

https://pmsinformationsystem.forumotion.net

Back to top Go down

Position the file cursor in CL Empty Re: Position the file cursor in CL

Post  maran Mon Jul 27, 2009 8:03 pm

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
maran
maran
Admin

Posts : 442
Join date : 2009-07-24

https://pmsinformationsystem.forumotion.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum