5 pts.
 New to Journaling AS/400
How do you start journaling files that were created long before the journal & receiver were created??

Software/Hardware used:
ASKED: March 17, 2009  9:38 PM
UPDATED: March 19, 2009  3:14 PM

Answer Wiki:
Use command STRJRNPF Phil
Last Wiki Answer Submitted:  March 17, 2009  9:41 pm  by  philpl1jb   44,630 pts.
All Answer Wiki Contributors:  philpl1jb   44,630 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

First off determine exactly which files you want to journal. You don’t want to journal a development source file!

Then I would recommend that you create a library to hold the journals.

Create a journal receiver:
CRTJRNRCV JRNRCV(JRNLLIN/JRNLRCV) THRESHOLD(5000) +
TEXT(‘Journal Receiver’)

Create the journal:
CRTJRN JRN(JRNLLIB/JRNL) JRNRCV(NRNLLIB/JRNLRCV) +
MNGRCV(*SYSTEM) TEXT(‘Journal’)

Start journaling:
STRJRNPF FILE(DTALIB/FILE1 DTALIB/FILE2) +
JRN(JRNLLIB/JRNLRCV) IMAGES(*BOTH)

You can substitute *BEFORE or *AFTER for the IMAGES parameter. This will affect how large the journal becomes.

Then save the files being journaled. This creates a starting point in the journal for possible restores. I create a save file in the journaling library and save the files to that save file.

 135 pts.

 

You may also wish to omit the file open and close entries from getting journaled. Otherwise, a lot of extra space gets taken up in the receiver for information that you may not really need or care about.

To do so, specify the *OPNCLO value for the OMJTRNE keyword in the STRJRNPF command.

STRJRNPF FILE(DTALIB/FILE1 DTALIB/FILE2) +
JRN(JRNLLIB/JRNLRCV) IMAGES(*BOTH) OMTJRNE(*OPNCLO)

 4,275 pts.

 

After all that you can have a process copy the files to holding file. Then incrament the journal recv by one and dlt the old one. This way you will not have to monitor it all the time. We keep 30 days of journals for some specific files. Here is the bottom part of the journal clear…

* CLEAR JOURNALS IF ITS PAST 10:00 PM */
/* CHGVAR VAR(&TIME) VALUE(230101) */
IF COND(&TIME *GE ’220000′) THEN(DO)
LOOP: CHGVAR VAR(&RECEIVER) VALUE(&RECV *TCAT &CHRNUM)
CHKOBJ OBJ(&RECEIVER) OBJTYPE(*JRNRCV)
MONMSG MSGID(CPF9801) EXEC(GOTO CMDLBL(INCREM))
DLTJRNRCV JRNRCV(&RECEIVER) DLTOPT(*IGNINQMSG *IGNTGTRCV)
MONMSG MSGID(CPF7022) EXEC(GOTO CMDLBL(CHANGE))
INCREM: CHGVAR VAR(&DECNUM) VALUE(&DECNUM + 1)
CHGVAR VAR(&CHRNUM) VALUE(&DECNUM)
GOTO CMDLBL(LOOP)
CHANGE: CHGJRN JRN([your journal]) JRNRCV(*GEN) SEQOPT(*RESET) +
MSGQ(RON) RCVSIZOPT(*RMVINTENT)
MONMSG MSGID(CPF7018 CPF0000) EXEC(DO)
SNDMSG MSG(‘FAILED TO CHANGE JOURNALS’) TOUSR(you)
GOTO CMDLBL(END)

 1,780 pts.