RPGIV @ Work

A unique site for RPG and System i Lovers

Welcome!

Hi, this site will provide all what you need in System i and RPG developments.

My Name is Chamara Withanachchi, System i Expert and RPG Developer. And in the field for last 11 years.

I hope you will find lot of valuable information from this site

Library Journaling Print E-mail
User Rating: / 0
PoorBest 
Written by Chamara Withanachchi   

Probably the biggest enhancement to journaling in V6R1 is the capability to journal libraries. This sounds simple on the surface, but it’s necessitated and allowed changes that may not be immediately obvious. Essentially, this capability lets you journal changes made to the library. But it also lets you define rules that allow i5/OS to automatically start journaling any objects created in, copied to or restored into the library based on inheritance rules you specify. This is similar to the support already in place for journaling directories.


The new library journal support moves that function to a new set of commands, Start Journal Library (STRJRNLIB) and End Journal Library (ENDJRNLIB), without the hassle of typing in all upper case and counting columns to make sure all of the fields are lined up properly in the data area.


The STRJRNLIB command lets you specify the library you want journaled (via the LIB parameter), the name and library of the journal to use (via the JRN parameter), and the inheritance rules to use to determine whether a new object should be journaled (via the INHRULES parameter). The INHRULES parameter contains five fields, and multiple rules may be specified. The fields for INHRULES are the object type, operation, rule action, images and omit journal entry. Each field has valid-values rules:


  • Valid values for the object type field are *FILE, *DTAARA, *DTAQ and *ALL.
  • Valid values for the operation field are *ALLOPR, *CREATE, *MOVE, *RESTORE and *RSTOVRJRN. These operations are identical to the operations allowable in the QDFTJRN data area with one exception, *RSTOVRJRN. When *RESTORE or *RSTOVRJRN has been specified, if an object is restored over a previously existing object, it will retain the same journal state and journaling attributes of the object it was restored over. However, if the object doesn’t exist in the library when it’s restored into the library and *RESTORE is specified, the object will first attempt to be journaled to where it was journaled to at the time of the save. If this is unsuccessful, it will go to the library’s journal. But if *RSTOVRJRN is specified, the object will go to the library’s journal regardless of its journal state and journaling attributes at the time of save.
  • Valid values for rule action are *INCLUDE or *OMIT. If *INCLUDE is specified, all objects matching the object type and operation field will inherit the journal state of the library and journaling attributes specified by this rule. If *OMIT is specified, those objects matching the object type and operation will be excluded from journaling. This is helpful, for example, if you need to journal an object for all operations except one.
  • Valid values for the images field are *OBJDFT, *BOTH and *AFTER.
  • Valid values for the omit journal entry field are *OBJDFT, *NONE and *OPNCLO.

If a user wanted to journal all of the newly created files in library MYLIB and any newly created, restored or copied, but not moved, data areas in library MYLIB to journal MYJRNLIB,MYJRN, the following command would do the job:


STRJRNLIB LIB(MYLIB) JRN(MYJRNLIB/MYJRN) INHRULES((*FILE *CREATE *INCLUDE *BOTH *OPNCLO) (*DTAARA *ALLOPR *INCLUDE *AFTER) (*DTAARA *MOVE *OMIT))
<Previous   Next>