Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 7

_______________________________________________________________________

Concepts of File Journal Management on AS/400

Version 1.0
Dated: March 22, 2006

Author - Prashant Patil

________________________________________________________________________
Page 1
Patni Internal
_______________________________________________________________________
_

Concepts of File Journal Management :-

Journal management provides a means by which you can record the activity of objects on your system.
When you use journal management, you create an object called a journal. The journal records the
activities of the objects you specify in the form of journal entries. The journal writes the journal
entries in another object called a journal receiver.
Journal management provides you with the following:
1 Decreased recovery time after an abnormal end
2 Powerful recovery functions
3 Powerful audit functions
4 The ability to replicate journal entries on a remote system

Journals
When a change is made to a file and you are using journals, the system records the change in
a journal receiver and writes the receiver to auxiliary storage before it is recorded in the
file. Therefore, the journal receiver always has the latest database information.
Journal entries record activity for a specific record or for the file as a whole. Each entry
includes bytes of control information that identify the source of the activity (such as user,
job, program, time, and date). For changes that affect a single record, record images are
included after the control information. The record image before the change can also be
included. You can control whether to create a journal both before and after record images or
just after record images by specifying the IMAGES parameter on the Start Journal Physical File
(STRJRNPF) command.
All journal database files are automatically synchronized with the journal when the system is
started (IPL time). If the system session ended abnesormally, some database changes may be
in the journal, but some of these changes may not be reflected in the database files. If that is
the case, the system automatically updates the database files from the journal.
Journals make saving database files an easier and faster task. For example, instead of saving
an entire file every day, simply save the journal receiver that contains the changes to that
file. You might still save the entire file on a weekly basis. This method can reduce the amount
of time it takes to perform your daily save operations.

Journals Entries:-
When changes is made in Journalized file, the entries for each change are written in Journal
known as Journal Entries. Journal entries contain information such as:
 The job name, program name, and user that caused the journal entry to be deposited
into the local journal.
 The date and time the journal entry was deposited into the local journal.
 Journal code.
 Entry type.
Information that is unique to each journal entry type, called entry specific data.
For example, the entry specific data associated with the put of a record to a physical file
member (journal code R, entry type PT) contains an image of the actual record that was put.
The rest of the journal entry information helps determine at what time, by what user the entry
was sent, and other details. If a user sends information to the journal using the SNDJRNE
command or QJOSJRNE API (journal code U, entry type is defined at send time by the user),
________________________________________________________________________
Page 2
Patni Internal
_______________________________________________________________________
_
the entry specific data contains what was specified at that time. For a complete description of
the information contained in journal entries that the system sends and all the possible journal
codes and entry types.
The journal Entries consists of following information
The journal code.:-This code is set by the system to indicate the kind of journal entry that was
recorded. The journal codes and brief descriptions for the journal codes follow:
 A - System accounting entry
 C - Commitment control operation
 D - Database file operation
 F - Database file member operation
 J - Journal or journal receiver operation
 I - Access path operation
 L - License management
 M - Network management data
 O - Object oriented entry
 P - Performance tuning entry
 R - Record level operation
 S - Distributed mail service for SNA distribution services (SNADS),
The journal entry type.:- This code is set by the system to indicate the specific type of
journal entry. There are many different types of journal entries that can occur for each
journal code.
For journal code A the possible journal entry types are:
 DP - Direct print information
 JB - Job accounting segment
 SP - Spooled print information
For journal code C the possible journal entry types are:
 BC - Commitment control environment begun
 CM - Set of record changes committed
 EC - Commitment control environment ended
 LW - Logical unit of work ended
 RB - Set of record changes rolled back
 SC - Commit cycle started

For journal code D the possible journal entry types are:
 DF - Delete file
 EF - End journaling for file
 FM - File moved
 FN - File renamed
 JF - Start journaling for file
For journal code F the possible journal entry types are:
 AY - Journal changes applied to physical file member
 CE - Change end of data for physical file
 CH - Change file
 CL - Physical file member closed
 CR - Physical file member cleared
 DE - Physical file member deleted record count
 EJ - Journaling for physical file member ended
 EP - Journaling for access path ended
 FD - Physical file member forced to auxiliary storage
 FI - Internal journal entry format information

________________________________________________________________________
Page 3
Patni Internal
_______________________________________________________________________
_
 IU - Physical file member in use at abnormal termination
 IZ - Physical file member initialized
 JM - Journaling for physical file member started
 JP - Journaling for access path started
 MD - Member removed from physical file
 MF - Storage for physical file member freed
 MM - Physical file containing member moved

 MN - Physical file containing member renamed

 MR - Physical file member restored

 MS - Physical file member saved

 OP - Physical file member opened

 PD - Access path deleted

 PM - Access path moved

 PN - Access path renamed

 RC - Journaled changes removed from physical file member

 RG - Physical file member reorganized

 SA - Point at which APYJRNCHG command started execution

 SR - Point at which RMVJRNCHG command started execution

 SS - Start of save while active of physical file member


For journal code I the possible journal entry types are:
 IB - Access path recovery
 IC - Access path recovery
 IH - Access path recovery
 IV - Access path recovery

For journal code J the possible journal entry types are:
 EZ - End journaling for journal receiver
 IA - System IPL after abnormal system end
 IN - System IPL after normal system end
 JR - Start journaling for journal receiver
 KR - Keep journal receivers for recovery
 LA - Activate journal
 LI - Inactivate journal
 NK - Do not keep journal receivers for recovery
 NR - Identifier for next journal receivers
 PR - Identifier for previous journal receivers

________________________________________________________________________
Page 4
Patni Internal
_______________________________________________________________________
_
 RD - Journal receiver deleted
 RF - Storage for journal receiver freed
 RR - Journal receiver restored
 RS - Journal receiver saved
 XP - Internal entry
For journal code L the possible journal entry types are:
 LK - License key not valid
 LL - Usage limit changed
 LU - Usage limit exceeded
For journal code M the possible journal entry types are:
 SN - Simple Network Management Protocol (SNMP) information
 TF - IP filter rules actions
 TN - IP NAT rules actions
 TS - VPN information
For journal code O the possible journal entry types are:
 AI - Update, after image
 BI - Update, before image
 XA - Allocate object
 XB - Bundled entries
 XD - Deallocate object
 XI - Index operation
 XS - Synchronization
 XT - Transaction state change
Journalized file Name

Journal Receiver: -
A journal receiver is the object that contains journal entries, and can be associated with
either a local or remote journal. For a journal receiver attached to a local journal, journal
entries are directly deposited into the journal receiver. For a journal receiver attached to a
remote journal, journal entries are replicated into the journal receiver from the source journal
receiver associated with the upstream source journal.
The process to attach journal to file:-
If you want attach journal to a file you can use following commands: -
First create the journal and associated journal receiver that you want to attach to file in your
working library using
CRTJRNRCV(Create Journal Receiver):-
While Creating Journal receiver specifies storage space threshold value (in KB).This will
help to send the message to Message Queue if no of journal entries in journal are exceed than
this limit.
CRTJRN (Create Journal): -
The journal that you are going to create attach to Journal receiver using earlier
command.
The following parameters are important while creating Journal
Journal message queue (MSGQ): - You can specify the message queue, which will receive
message if journaling an entry is abandoned
Manage receivers (MNGRCV); - You can specify whether user will do any action or system will
do any action when attached journal receiver reaches its threshold. If you specify the system
as option then system will remove the current receiver and attach new receiver to Journal.
Other than this during IPL (Initial Program Load) the system will attach new journal receiver
and remove old one.

________________________________________________________________________
Page 5
Patni Internal
_______________________________________________________________________
_
Delete receivers (DLTRCV): - Specifies whether the system deletes journal receiver when they
are no longer needed or leaves them on the system for the user to delete after they have been
detached by system change-journal management or by a user-issued CHGJRN command.
Receiver size options (RCVSIZOPT): - Specifies the options that affect the size of the receivers
attached to the journal.

STRJRNPF (Start Journal Physical File): -


Specify the file name to which you want to attach journal along with journal and
Journal Reciver.The following parameter can be specified; -
Record images (IMAGES): -
Specifies the kinds of record images to be written to the journal for changes to records in the
file.
This means that whether you want to create journal after changes in file or both i.e. before
any changes in file and after.
Journal entries to be omitted (OMTJRNE): -
Specifies the journal entries that are omitted. This means that whether you don’t want to omit
any journal entry in file or you want to omit OPEN and CLOSE journal entry to be omitted.

Before issuing this command make sure that the file is not being locked by system (process).

CHGJRN (Change Journal): -


This command allows changing journal receiver associated with journal if journal receiver is
full.
You can use these command if you receive message stating that journal receiver is full.

ENDJRNPF (End Journaling PF Changes): -


If you want to stop journaling changes made in file, you can issue this command. Before issuing
this command make sure that the file is not being locked by system (process).

Remove Journal Changes (RMVJRNCHG):-


The Remove Journal Changes (RMVJRNCHG) command removes the changes that have been
journal for a particular member of a database file. The journal changes are removed from the
file from the specified starting point to the ending point. The journal entries are processed in
reverse of the order in which they were placed into the journal receiver, from the most recent
to the oldest. The starting point can be identified as the last journal entry in the specified
Journal receiver range, the point at which a file was last saved, or a particular entry in the
receiver range. The ending point can be the first journal entry or a particular entry in the
specified
journal receiver range, or the point at which a file was opened by a specified job. The
CMTBDY parameter can be used for handling changes that are pending in the file
Changes that are pending in the file.
Display Journal (DSPJRN): -
The Display Journal (DSPJRN) command allows you to convert journal entries (contained in one
or more receivers) into a form suitable for external representation. Output of the command
can be displayed or printed with the job's spooled printer output or directed to a database
output file. If the database file exists, records may either replace or be added to the current
data in the indicated file member. The system creates the specified database file and member
if they do not exist. Database files created by the system have a standard format. A warning
message is sent and the records are truncated if any of the entries are longer than the
specified maximum record length of the output files.
The contents of selected entries in the journal receivers may be converted for output. It is
also possible to selectively limit the entries that are displayed. If no journal entries satisfy the
selection or limitation criteria, an escape message is sent indicating that fact.
________________________________________________________________________
Page 6
Patni Internal
_______________________________________________________________________
_
Gaps may exist in the sequence numbers of the entries converted. These occur because some
of the journal entries represent internal system information. These entries are not converted.
It is possible to show journal entries whose journal sequence numbers are reset in the chain of
receivers being specified. Using above-mentioned code in journal entries you can dump only
required journal entries in Output file.

Note:- You can start and end journaling a file at anytime during process.

________________________________________________________________________
Page 7
Patni Internal

You might also like