|
#1
|
|||
|
|||
|
Hello again,
Slowely my CL skills are increasing, but unfortunately again I am slightly stumped. The program is designed to: 1. Display all objects within a library to an outfile. 2. Read the outfile 3. End Journalling on all PF 4. Loop till all PF have ended journalling 5. Delete Journal in library 6. Delete Journal Receiver in library 7. Create Journal Receiver in library 8. Create Journal in library 9. Display all objects to an outfile 10. Receive the outfile. 11. Start Journalling on all PF 12. Loop till all PF have been journalled. 13. End Program Problem is that step 4. Loop and end journalling on all PF, once this reached EOF, the program just ends. How do I get this to simply just move to the next step? Thanks in advance. You guys have helped me through many obstacles. Regards Stephen |
|
#2
|
||||
|
||||
|
The code in red below is causing you to move directly to the end of your program immediately when you hit EOF on the first loop. That explains why you don't get past step 4.
Your other problem is that your second loop won't do anything because you can't restart reading the outfile again. If you are at V5R3, you can define two different outfiles and use one in each step. Code:
PGM PARM(&LIB)
DCL VAR(&LIB) TYPE(*CHAR) LEN(10)
DCLF FILE(QADSPOBJ)
OVRDBF FILE(QADSPOBJ) TOFILE(QTEMP/JRNPRDLIB)
DSPOBJD OBJ(&LIB/*ALL) OBJTYPE(*FILE) +
OUTPUT(*OUTFILE) OUTFILE(QTEMP/JRNPRDLIB)
MONMSG MSGID(CPF2110) EXEC(SNDPGMMSG MSG('Library +
Not Found'))
MONMSG MSGID(CPF2123) EXEC(SNDPGMMSG MSG('Object +
Type Not Found'))
LOOP: RCVF
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))
IF COND(&ODOBAT = PF) THEN(DO)
ENDJRNPF FILE(&LIB/&ODOBNM)
MONMSG MSGID(CPF0000)
GOTO CMDLBL(LOOP)
ENDDO
DLTJRN JRN(&LIB/QSQJRN)
DLTJRNRCV JRNRCV(&LIB/QSQJRN*)
CRTJRNRCV JRNRCV(&LIB/QSQJRN0001) THRESHOLD(1000000)
CRTJRN JRN(&LIB/QSQJRN) JRNRCV(&LIB/QSQJRN0001) RCVSIZOPT(*MAXOPT2)
DSPOBJD OBJ(&LIB/*ALL) OBJTYPE(*FILE) +
OUTPUT(*OUTFILE) OUTFILE(QTEMP/JRNPRDLIB)
MONMSG MSGID(CPF2110) EXEC(SNDPGMMSG MSG('Library +
Not Found'))
MONMSG MSGID(CPF2123) EXEC(SNDPGMMSG MSG('Object +
Type Not Found'))
LOOP1: RCVF
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))
IF COND(&ODOBAT = PF) THEN(DO)
STRJRNPF FILE(&LIB/&ODOBNM) JRN(&LIB/QSQJRN)
MONMSG MSGID(CPF0000)
GOTO CMDLBL(LOOP1)
ENDDO
GOTO CMDLBL(LOOP1)
RETURN
END: ENDPGM
__________________
Virgil Green |
|
#3
|
|||
|
|||
|
Dear Stephen,
The RCVF command is used twice.... This is resulting in the loop going to the command label END. As you are aware we can declare only one PF in a CL program, i would suggest that you can tackle the situation by using two CL programs and reading the file in the second CL program so that it is read from the beginning. Regards Ajay |
![]() |
| Thread Tools | |
| Display Modes | |
|
|