R3_GET_SYSTEMLOG

The R3_GET_SYSTEMLOG script element reads the system log of an SAP system during a defined period of time as text and stores it in a file. If you define the name of an application server, the script element supplies the system log of this server. Otherwise, the system reads the central SAP system log. By default, created files are stored on the computer on which the agent is installed  (for example, R3_GET_JOB_SPOOL; FILE=).

Tip: You can prepare and edit the system log using the script elements for data sequences. R3_GET_SYSTEMLOG is used in the EVENT.R3SYSLOG event job in client 0000 for this purpose.

  • Use the PREP_PROCESS script function to create a data sequence with the data of the system log. For more information, see PREP_PROCESS.
  • Use a process loop to process the data sequence line by line. For more information, see :PROCESS... :TERM_PROCESS... :ENDPROCESS.
  • Read data in individual lines or columns of the data sequence. For more information, see GET_PROCESS_LINE.

Transaction: SM21

Interface: Standard

Syntax

R3_GET_SYSTEMLOG

    FILE=...
    [,SERVER=...]
    [,FROM_DATE=...]
    [,FROM_TIME=...]
    [,TO_DATE=...]
    [,TO_TIME=...]

Parameters

  • R3_GET_SYSTEMLOG
    Reads the system log of an SAP system during a specified period of time

  • FILE=
    Name of a file to which the read SAP system log should be stored
    Format: name or script literal

  • SERVER=
    (Optional) Name of an SAP application server. The name of this SAP application server must be specified in the format Host_SID_SYSNR where Host is the computer name, SID is the system ID from SAP, and SYSNR is the number of the SAP instance.

  • FROM_DATE=
    (Optional) Start date of the selection from the system log
    Format: YYYYMMDD
    Default value: 20010101

  • TO_DATE=
    (Optional) End date of the selection from the system log.
    Format: YYYYMMDD
    Default value: current date

  • TO_TIME=
    (Optional) End time of the selection from the system log.
    Format: HHMMSS
    Default value: 235959

  • ENCODING=

    (Optional) Encoding that should be used for the generated output file (FILE= parameter).

    Example: UTF-8

    Default value: ISO-8859-1

    When you specify an encoding format that is not supported or invalid, the job aborts with an error message.

    The SAP Forms provide an input assistant for this field which lists all the supported encoding formats.

Example

The following example reads the central SAP system log of the previous week. The start date for the system log selection is calculated using the script function SUB_DAYS. The current date is the basis of this calculation.

:RSET &TODAY#          = SYS_DATE ('YYYYMMDD')
:
RSET&LAST_WEEK#      = SUB_DAYS ('YYYYMMDD:&TODAY#', 7)
R3_GET_SYSTEMLOG FILE = 'c:\t46_systemlog.txt', SERVER=, FROM_DATE='&LAST_WEEK#'

See also:

seealso

About SAP JCL