Previous Topic: Interface Syntax

Next Topic: $RWCALL OPT=INFO


$RWCALL OPT=GENERATE

This function generates a report. Optionally, the function presents the Generate a Report panel on which the report details can be entered, or the Report List.

This function has the following formats:

&CONTROL SHRVARS=($RW)
-EXEC $RWCALL   OPT=GENERATE
              [ MODE= { DEFGEN | GENERATE | PRTGEN } ]
              [ APPL= repapplid ]
              [ TYPE= { PUBLIC | PRIVATE } ] 
              [ USERID=userid ] 
              [ NAME=name ] 
              [ PRINTER=printer ] 
              [ OWNER=userid ]
              [ HOLD= { NO | YES } ] 
              [ KEEP= { NO | YES } ] 
              [ COPIES=n ] 
              [ WAIT= { NO | YES } ] 
              [ SYSTEM=system ] 
              [ RECCAT=record category ]
-EXEC $RWCALL   OPT=GENERATE
                MODE=LIST 
                APPL=repapplid 
              [ GROUP=group ]

Operands

OPT=GENERATE

Generates a report.

MODE= { DEFGEN | GENERATE | PRTGEN | LIST }

Specifies the mode of operation.

DEFGEN

Displays the Generate a Report panel.

GENERATE

Generates the report.

PRTGEN

Generates the report and displays the PSM Confirm Printer panel for the specification of printer details.

LIST

Displays a Report List in the form of an action list. The list contains all public and private reports for the current user which belong to the report application set in the APPL operand. Only those reports with a status of ACTIVE are listed.

APPL=repapplid

Specifies the ID of the report application to which the report belongs.

TYPE={ PUBLIC | PRIVATE }

Specifies the type of report.

PUBLIC

Specifies that the report is a public report.

PRIVATE

Specifies that the report is a private report.

USERID=userid

Specifies the user ID of the user who owns the report if it is a private report.

Default: Value of &USERID if TYPE is set to PRIVATE

Note: If MODE is GENERATE or PRTGEN, and TYPE and USERID are not specified, the system looks for a PRIVATE report owned by the invoking user ID (that is, the value of &USERID) with the name specified. If not found, the system looks for a PUBLIC report with the name specified.

NAME=name

Specifies the name of the report.

PRINTER=printer

Specifies the name of the printer. The printer must have previously been defined to PSM.

Default: Printer assigned to the owner of the report as their default printer

OWNER=userid

Specifies 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. The default is the value of &USERID.

HOLD={  NO | YES }

Specifies whether PSM assigns the report a status of HELD when added to the Print Spool File.

KEEP={  NO | YES }

Specifies whether PSM leaves the report on the Print Spool File after being printed.

COPIES=n

Specifies the number of copies of the report to print.

Default: 1

Limits: 1 through 255

WAIT={ NO | YES }

Specifies whether control is returned to the requester immediately after the report is started or on completion of the report.

SYSTEM=system

Specifies the system name to use instead of the name defined in the table entry for the specified report application.

RECCAT=record category

Specifies the record category to use instead of the category defined in the table entry for the specified report application.

GROUP=group

Specifies the name of the group to which reports belong, to be included in the Report List when the MODE operand is set to LIST.

Variables

&$RWCRITn

These variables can be set to the data criteria that is to be used by the service procedure and/or report exit procedure in determining the data to be included in the report when the MODE operand is not set to LIST. The valid value for n is in the range 1 to 99999. The first blank variable indicates the end of the data criteria.

&$RWUSRDc

These user data variables can be set to user data that is to be used by the service procedure and/or the report exit procedure when the MODE operand is not set to LIST. The variable c is between 0 and 5 alphanumeric and/or national characters. These variables are not set or cleared by the system, therefore must be completely managed by your installation-defined NCL procedures.

Return Codes

&RETCODE = 0

$RWCALL completed successfully. $RWFDBK is set as follows:

1

RETURN command entered or function key pressed

&RETCODE = 4

$RWCALL completed successfully. Request denied. &SYSMSG is set to an error message and &$RWFDBK is set to one of the following values:

1

User not authorized for the request

8

Report not defined

10

No report defined within the specified range

&RETCODE = 8

An error occurred. &SYSMSG is set to an error message.

Examples

&CONTROL SHRVARS=($RW)
-EXEC $RWCALL OPT=GENERATE MODE=DEFGEN
&CONTROL SHRVARS=($RW)
-EXEC $RWCALL OPT=GENERATE MODE=DEFGEN APPL=$SAIMPB TYPE=PUBLIC
&CONTROL SHRVARS=($RW)
&$RWCRIT1 = &STR $PBSEVERITY=1
&$RWCRIT2 = &STR AND
&$RWCRIT3 = &STR $PBFIXED=NO
-EXEC $RWCALL OPT=GENERATE MODE=GENERATE APPL=$SAIMPB +
    TYPE=PUBLIC NAME=OPENPROBLEMS
&CONTROL SHRVARS=($RW)
-EXEC $RWCALL OPT=GENERATE MODE=GENERATE APPL=$SAIMPB +
    TYPE=PRIVATE USER=USER01 NAME=TEST1
&CONTROL NOSHRVARS
-EXEC $RWCALL OPT=GENERATE MODE=LIST APPL=ZPRPROB

Notes

When MODE is set to DEFGEN, the APPL, TYPE, USERID, NAME, PRINTER, OWNER, HOLD, KEEP and COPIES operands are used to initialize fields on the Generate a Report panel.

When MODE is set to LIST, the variables &$RWCRITn and &$RWUSRDn are ignored.

When MODE is set to PRTGEN, the PRINTER, HOLD, KEEP and COPIES operands are ignored. Instead, the values entered on the Confirm Printer panel are used to generate the report.