Previous Topic: $CACALL API

Next Topic: Action=BUILD Class=FKA


Action=BUILD Class=CRITERIA

This statement builds a criteria using the criteria definition. You can supply values for the variables used in the definition. Items can be tested against the built criteria.

This statement has the following format:

&CONTROL SHRVARS=($CR,pref,...pref)
-EXEC $CACALL    OPT=ACTION
                 ACTION=BUILD
                 CLASS=CRITERIA
                 NAME=‘APPL=application id 
                      [TYPE={PUBLIC | PRIVATE | FREEFORM}]
                      [USER=userid]
                      NAME=criteria name’
                 PARMS=‘MESSAGE=message’
APPL=application id

A required parameter (not applicable for TYPE=FREEFORM) giving the application identifier of the criteria.

TYPE={PRIVATE | PUBLIC | FREEFORM}

An optional parameter giving the type of the criteria. Valid values are as follows:

PUBLIC

Public criteria—available for general use.

PRIVATE

Private criteria—owned by a specific user ID.

FREEFORM

Free-form criteria—presents a panel for the user to enter criteria.

Note: If you do not specify TYPE or USER, the function attempts to find a PRIVATE definition owned by the invoking user ID first. If unsuccessful, the function uses a PUBLIC definition.

USER=userid

An optional parameter (not applicable for TYPE=PUBLIC and TYPE=FREEFORM) giving the user ID of the user owning the criteria. Default is the user ID of the user invoking the function.

NAME=criteria name

A required parameter (not applicable for TYPE=FREEFORM) giving the name of the criteria.

MESSAGE=message

A message to be displayed on the criteria panel, if one is defined.

Input Variables

Variables with prefixes as specified in SHRVARS.

Return Variables

This statement contains the following return variables:

&$CRCRITnnnn

The criteria lines.

&$CRCRITTOTAL

The total number of criteria lines built (up to 9999). The value gives the number of &$CRCRITnnnn variables.

&$CRPANEL

Set to YES or NO indicating whether a run time panel is defined.

&$CRPANELCMD

Set to EXIT or ACTION indicating the command executed to terminate the run time panel, if a run time panel is defined, otherwise set to null.

&SYSMSG

System message. Contains the error message (for return code 8).

Feedback Codes

If a return code of 8 is set, then additional information is available as one of the following feedback codes, set in &$CAFDBK:

1

Definition not found

3

Canceled by exit

8

Processing error

10

Nesting level exceeded

Example

The following statements build the public criteria ZPRPR001 for the application identified by the ID ZPR:

&CONTROL SHRVARS=($CR,ZPR)
-EXEC $CACALL     OPT=ACTION +
                  ACTION=BUILD +
                  CLASS=CRITERIA +
                  NAME=‘APPL=ZPR +
                          TYPE=PUBLIC +
                          NAME=ZPRPR001