Using the Retrieve Journal Entry command in a program
You can use the Retrieve Journal Entry (RTVJRNE) command in a control language (CL) program to retrieve a journal entry and place it in variables in the program.
You can retrieve the following items:
- Sequence number
- Journal code
- Entry type
- Journal receiver name
- Library name for the journal receiver
- Journal entry-specific data
For example, you can use this command to automate your recovery procedures or to change the journal receivers and then save them.
In Figure 1, the RTVJRNE command determines when job 000666/QPGMR/WORKST01 last opened file ORDENTP:
PGM
DCL &SEQ# TYPE(*DEC) LEN(10 0)
DCL &JRNE TYPE(*CHAR) LEN(200)
DCL &DATE TYPE(*CHAR) LEN(6)
DCL &TIME TYPE(*CHAR) LEN(6)
RTVJRNE JRN(DSTJRN/JRNLA) FILE(DSTPRODLIB/ORDENTP) +
RCVRNG(DSTJRN/RCV30 DSTJRN/RCV27) +
FROMENT(*LAST) TOENT(*FIRST) SEARCH(*DESCEND) +
JRNCDE(F) ENTTYP(OP) JOB(000666/QPGMR/WORKST01) +
RTNSEQNBR(&SEQ#) RTNJRNE(&JRNE)
CHGVAR &DATE (%SST(&JRNE 19 6))
CHGVAR &TIME (%SST(&JRNE 25 6))
ENDPGM