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

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

Position the file cursor in CL

View previous topic View next topic Go down

Position the file cursor in CL

Post  maran on 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?
avatar
maran
Admin

Posts : 442
Join date : 2009-07-24

View user profile http://pmsinformationsystem.forumotion.net

Back to top Go down

Re: Position the file cursor in CL

Post  maran on 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
avatar
maran
Admin

Posts : 442
Join date : 2009-07-24

View user profile http://pmsinformationsystem.forumotion.net

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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