SQL iQuery Script Built-in Functions

Retrieve System Value

SYSVAL or SYSVALUE

The SYSVAL() built-in function returns the value for any System Value.

Syntax

The SYSVAL built-in function returns the system value whether it is a textual value or a numeric value to the target, usually a Session Variable. Any system value is supported.

Parameters

  1. The system value. The system value name may be unquoted, quoted and it can be in upper or lower case. It is case-insensitive.
#define &AUDITLVL = sysval(QaudCtl);
if (&auditLvl = '*NONE');
#msg Your QAUDCTL System Value must not be &AuditLvl to continue.
return;
endif;

select *
from table (QSYS2.DISPLAY_JOURNAL(JOURNAL_LIBRARY=>'QSYS',
JOURNAL_NAME=>'QAUDJRN',
STARTING_RECEIVER_NAME=>'*CURCHAIN',
JOURNAL_ENTRY_TYPES=>'PW',
STARTING_TIMESTAMP=>current_timestamp - 72 hours)) je ;

 The output written to the joblog is:

Your QAUDCTL System Value must not be *NONE to continue.