Previous Topic: Function

Next Topic: Return Codes


Variables

The share variables facility of NCL is used to pass data to the report exit procedure and to let it pass data back to the generator. The report exit procedure is executed with &CONTROL NOSHRVARS=(#RW) specified. All variables not starting with the characters #RW can be accessed and set by the report exit procedure and variables containing data (data fields) can be modified. The variables set by the generator indicating the status of the current environment are as follows:

&$RWOPT

This variable is set to indicate the processing that is to be performed by the report exit. This variable can be set to one of the following variables:

INIT

Initialization processing is to be performed

TERM

Termination processing is to be performed

ITEM

Item processing is to be performed

&$RWAPPL

This variable is set to the ID of the report application to which the report being generated belongs.

&$RWTYPE

This variable is set to the type of report being generated. Type can be one of the following:

PUBLIC

The report is a public report

PRIVATE

The report is a private report

&$RWUSERID

This variable is set to the user ID of the user who owns the report if it is a private report.

&$RWNAME

This variable is set to the name of the report being generated.

&$RWDESC

This variable is set to the brief description of the report being generated.

&$RWITEM

This variable is set to indicate the item that is being processed when &$RWOPT is set to ITEM. Item can be set to one of the following values:

RH

Report header

PH

Page header

CH

Control break header

DF

Data format or sequence of data formats

CT

Control break trailer

PT

Page trailer

RT

Report trailer

&$RWITEMKEY

This variable is set to the sort field number of the control break header or trailer when &$RWITEM is set to CH or CT.

&$RWFMTSEQ

This variable is set to a list of all the data format numbers separated by commas when &$RWITEM is set to DF. This variable can be modified to contain a list of data format numbers that are to be printed, in the order they are to be printed, separated by commas. To process but not print the record (that is, to perform totalling) set this variable to null.

&$RWSYSTEM

This variable is set to the system name that is defined in the table entry for the report application to which the report belongs. The system name can be overridden on the GENERATE call to $RWCALL.

&$RWRECCAT

This variable is set to the record category that is defined in the table entry for the report application to which the report belongs. Record category can be overridden on the GENERATE call to $RWCALL.

&$RWOWNER

This variable is set to the user ID of the user who is to own the report. This user ID is passed to PSM as the owning user ID for the report.

&$RWPAGES

This variable is set to the number of pages that have been printed.

&$RWLINES

This variable is set to the number of lines that have been printed.

&$RWRECS

This variable is set to the number of records that have been processed.

&$RWCRITTOTAL

This variable is set to the number of &$RWCRITn variables that contain data criteria. The value of this variable is in the range 0 to 99999.

&$RWCRITn

These variables are set to data criteria if the &$RWCRITTOTAL variable is greater than zero. The variable n is a number in the range 1 to the value of &$RWCRITTOTAL. The data criteria is used by the service procedure to determine which data is to be included in the report. The format of these variables is dependent on the service procedure.

&$RWUSRDc

This is user data and is as set by the caller of $RWCALL or the service procedure. The variable c is between 0 and 5 alphanumeric and/or national characters. These variables can be used to pass user data through the generator to the report exit procedure. They can also be accessed by the service procedure. These variables can also be modified by the report exit procedure. The variables are never set or cleared by the system and must be completely managed by your installation-defined NCL procedures.