The user log file contains the records created by the application program with LPUT calls. The user log files of an application are organized in a file generation group (FGG), i.e. a group of files numbered consecutively using their file names. The user log files are contained in the USLA directory in the filebase base directory. If user log files are required (LPUT calls), they must be created using the KDCUSLOG tool before the application starts.
Calling KDCUSLOG
Unix and Linux systems:
utmpath/ex/kdcuslog
filebase number [ S | D ]
On Windows systems from a command prompt window with
utmpath\ex\kdcuslog
filebase number [ S | D ]
Meaning of parameters:
filebase | Name of the directory under which the application is installed or is to be installed: Base of the KDCFILE. |
number | Number of files in each file generation group; maximum 9999. |
S | Single-file operation; default setting. |
D | Dual-file operation; the USLA directory is also created in the filebase base directory. |
KDCUSLOG first of all creates the filebase directory if it does not already exist. The USLA directory and, for dual-file operation, the USLB directory are then created in filebase. An INFO file which is used to store the current status information on files in the FGG is created in the USLA or USLB directory in which the current status information on files of the FGG are stored.
The USLA directory contains the following files:
/INFO: Administrative file
/0001: First file of the file generation (number 0001)
CAUTION!
If the file generation group already exists before the procedure is called, the old group is deleted and a new one created.
Example
Unix and Linux systems
The base name of the application is /home/userutm/example
. The user log file is to be operated in dual-file mode.
The file generation group for the user log file is created as follows:
utmpath/ex/kdcuslog /home/userutm/example 2 D
KDCUSLOG then creates the files:
/home/userutm/example/USLA/INFO /home/userutm/example/USLA/0001 /home/userutm/example/USLB/INFO /home/userutm/example/USLB/0001
Windows systems
The base name of the application is C:\utmsample
. The user log file is to be operated in dual-file mode.
The file generation group for the user log file is created as follows:
utmpath\ex\kdcuslog C:\utmsample 2 D
KDCUSLOG then creates the files:
C:\utmsample\USLA\INFO C:\utmsample\USLA\0001 C:\utmsample\USLB\INFO C:\utmsample\USLB\0001
Comments on the example
The UTM application always writes to the file currently with the highest number. With each KDCLOG command issued by the administrator, openUTM switches to the next file generation. The maximum number of numbered user log files is specified in the number parameter (in Example 2) when KDCUSLOG is called. If this number is reached and if the generation is switched with KDCLOG, the file with the lowest number is deleted.
Make sure that files which have not yet been evaluated are not overwritten.
openUTM does not write the user log records directly into the log file, rather saves them first of all in the page pool of the KDCFILE. If the page pool contains the number of UTM pages generated in MAX...,LPUTBUF=number, openUTM copies the records to the user log file. The records are copied asynchronously to active transactions. If the application is terminated normally, openUTM likewise copies the records to the user log file.
The number of UTM pages specified in LPUTBUF=number must be taken into account when generating the size of the page pool with MAX...,PGPOOL=number.
The MAX...,LPUTLTH=length statement affects the block length of the user log file. It is calculated by openUTM and can be greater than the standard block of 2KB.
openUTM can only copy LPUT records to the user log file if this file is created and can be accessed by openUTM.
Note that the user log file is overwritten from the start following a KDCDEF or KDCUPD run; otherwise, data is added to the end of the file. For this reason, you should evaluate the log records before a KDCDEF or KDCUPD run.
KDCUSLOG messages
KDCUSLOG outputs its messages to stdout and stderr. The KDCUSLOG messages are listed in the openUTM manual „Messages, Debugging and Diagnostics on Unix, Linux and Windows Systems”.