Send Journal Entry (SNDJRNE)

The Send Journal Entry (SNDJRNE) command is used to write a single journal entry to a specific journal. The entry can contain any information. The user may assign an entry type to the journal entry and may also associate the journal entry with a specified journaled object.

If the journal currently has a state of *STANDBY, then the journal entry will not be deposited unless OVRSTATE(*STANDBY) is specified.

The journal code for the entry is U, which indicates a user-specified journal entry.

Note: The Send Journal Entry (QJOSJRNE) Application Programming Interface (API) can also be used to write a user-specified journal entry to a specific journal. Using this API may improve performance and can provide additional function that is not available with this command. For more information, see the APIs topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.

Restrictions:

Parameters

Keyword Description Choices Notes
JRN Journal Qualified object name Required, Positional 1
Qualifier 1: Journal Name
Qualifier 2: Library Name, *LIBL, *CURLIB
TYPE Journal entry type Character value, 00 Optional, Positional 2
ENTDTA Entry data Character value, *BLANK Optional, Positional 3
FILE Journaled physical file Single values: *NONE
Other values: Element list
Optional
Element 1: Physical file Qualified object name
Qualifier 1: Physical file Name
Qualifier 2: Library Name, *LIBL, *CURLIB
Element 2: Member Name, *FIRST, *NONE
OBJ Object Single values: *NONE
Other values: Element list
Optional
Element 1: Object Qualified object name
Qualifier 1: Object Name
Qualifier 2: Library Name, *LIBL, *CURLIB
Element 2: Object type *FILE, *DTAARA, *DTAQ, *LIB
Element 3: Member Name, *FIRST, *NONE
OBJPATH Object Path name, *NONE Optional
OBJFID File identifier Hexadecimal value, *NONE Optional
FORCE Force journal entry *NO, *YES Optional
OVRSTATE Override journal state *NONE, *STANDBY Optional
OVRRMTFTR Override remote filter *NONE, *FTROBJ Optional

Journal (JRN)

Specifies the journal to contain the new journal entry.

This is a required parameter.

Qualifier 1: Journal

journal-name
Specify the name of the journal to contain the new journal entry.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, QGPL is used.
library-name
Specify the name of the library to be searched.

Journal entry type (TYPE)

Specifies the journal entry type of this journal entry.

00
The journal entry type is a '00' (hex F0F0).
entry-type
Specify a 2-character value or hex value used for the journal entry type. This value must be greater than or equal to hex C000.

If a hexadecimal value is specified that does not represent characters, that value is not shown on the DSPJRN display or on the printout.

Entry data (ENTDTA)

Specifies the user-specified data that is placed in the variable portion of the journal entry.

*BLANK
No user-specified data is placed in the journal entry.
'entry specific-data'
Specify up to 3000 characters, enclosed in apostrophes.

Journaled physical file (FILE)

Specifies the database file and physical file member with which this entry is associated.

If this parameter is specified, the parameters OBJ, OBJPATH or OBJFID cannot also be specified.

Single values

*NONE
There is no associated file for this entry.

Element 1: Physical file

Qualifier 1: Physical file

file-name
Specify the name of the physical or logical file with which this entry is associated.

Note: If the specified file is a logical file, the member name must be *NONE.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, QGPL is used.
library-name
Specify the name of the library to be searched.

Element 2: Member

*FIRST
The entry is associated with the first member in the physical file.
*NONE
The entry is associated with the file, not with any member of the file.
member-name
Specify the name of the physical file member with which this entry is associated.

Object (OBJ)

Specifies the object with which this entry is associated.

If this parameter is specified, the parameters FILE, OBJPATH or OBJFID cannot also be specified.

Single values

*NONE
There is no associated object for this entry.

Element 1: Object

Qualifier 1: Object

object-name
Specify the name of the object with which this entry is associated.

Note: If the specified object type is not *FILE, the member name value is ignored.

Note: If the specified object is a logical file, the member name must be *NONE.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, QGPL is used.
library-name
Specify the name of the library to be searched.

Element 2: Object type

*FILE
The entry is associated with a database file or database physical file member.
*DTAARA
The entry is associated with a data area.
*DTAQ
The entry is associated with a data queue.
*LIB
The entry is associated with a library.

Element 3: Member

*FIRST
The entry is associated with the first member in the physical file.
*NONE
The entry is associated with the file, not with any member of the file.
member-name
Specify the name of the physical file member with which this entry is associated.

Object (OBJPATH)

Specifies the path-qualified object name with which this entry is associated. Only objects whose path name identifies an object of type *STMF, *DIR or *SYMLNK that is in the "root" (/), QOpenSys, and user-defined file systems are supported.

Note: This parameter is Unicode-enabled. See "Unicode support in CL" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/ for additional information.

If this parameter is specified, the parameters FILE, OBJ or OBJFID cannot also be specified.

*NONE
There is no associated object for this entry.
path-name
Specify the name of the object with which this entry is associated.

File identifier (OBJFID)

Specifies the file-identifier (FID) with which this entry is associated. FIDs are a unique identifier associated with integrated file system related objects. This field is input in Hexadecimal format. Only objects whose FID identifies an object of type *STMF, *DIR or *SYMLNK that is in the "root" (/), QOpenSys, and user-defined file systems are supported.

If this parameter is specified, the parameters FILE, OBJ or OBJPATH cannot also be specified.

*NONE
There is no associated object for this entry.
file-identifier
Specify the FID for the object with which this entry is associated.

Force journal entry (FORCE)

Specifies whether the journal receiver is forced to auxiliary storage after the user entry is written to it.

*NO
The journal receiver is not forced to auxiliary storage.
*YES
The journal receiver is forced to auxiliary storage.

Override journal state (OVRSTATE)

Specifies whether the journal entry will be deposited, overriding the current state of the journal.

*NONE
None of the journal state values are overridden. That is,
  • The journal entry is deposited if the journal state is *ACTIVE.
  • The journal entry is not deposited and an error is not sent if the journal state is *STANDBY.
*STANDBY
The journal entry is deposited even if the journal state is *STANDBY.

Override remote filter (OVRRMTFTR)

Specifies whether the journal entry will be sent to remote journals, overriding filtering criteria.

*NONE
None of the remote journal filtering values are overridden.
*FTROBJ
The journal entry will be sent to remote journals even if the object specified on the Journaled physical file (FILE), Object (OBJ), Object (OBJPATH), or File identifier (OBJFID) parameter is marked for remote journal object filtering and a remote journal is filtering journal entries by object.

Examples

Example 1: Forcing Journal Receivers to Auxiliary Storage

SNDJRNE   JRN(JRNLA)  TYPE(AB)  ENTDTA('PROGRAM COMPLETE')
          FILE(MYLIB/ORDERENT MBR1)  FORCE(*YES)

If the journal currently has a journal state of *ACTIVE, this command places a journal entry of type AB (hex C1C2) with the journal entry data 'PROGRAM COMPLETE' in the current journal receivers attached to journal JRNLA as found by using the library search list. The entry is associated with member MBR1 of file ORDERENT in library MYLIB. The journal receiver is forced to auxiliary storage after the entry has been placed in it.

Example 2: Sending a Journal Entry

SNDJRNE   JRN(JRNLA)  TYPE(x'C1F1')  OVRSTATE(*STANDBY)

If the journal currently has a journal state of *STANDBY or *ACTIVE, this command places a journal entry of type 'A1' (hex C1F1) with no journal entry data in the current journal receiver attached to journal JRNLA as found by using the library search list. The entry is not associated with any physical file member.

Error messages

*ESCAPE Messages

CPFA0D4
File system error occurred. Error number &1.
CPF70C3
File &1 in library &2 not a database file.
CPF7003
Entry not journaled to journal &1. Reason code &3.
CPF7007
Cannot allocate member &3 file &1 in &2.
CPF7037
Object not journaled to journal &3.
CPF9801
Object &2 in library &3 not found.
CPF9802
Not authorized to object &2 in &3.
CPF9803
Cannot allocate object &2 in library &3.
CPF9809
Library &1 cannot be accessed.
CPF9810
Library &1 not found.
CPF9812
File &1 in library &2 not found.
CPF9815
Member &5 file &2 in library &3 not found.
CPF9820
Not authorized to use library &1.
CPF9822
Not authorized to file &1 in library &2.