Previous Topic: Action=DISPLAY Class=HELP

Next Topic: Action=DISPLAY Class=MENU


Action=DISPLAY Class=LIST

This statement displays a list.

This statement has the following format:

&CONTROL SHRVARS=($LH)
-EXEC $CACALL      OPT=ACTION
                   ACTION=DISPLAY
                   CLASS=LIST
                   NAME=‘APPL=application id
                          [TYPE={PUBLIC | PRIVATE}]
                          [USER=userid]
                          NAME=list name’
                   [PARMS=‘[FORMAT={ACTION | MSELECT |
                                    SSELECT | NUMBERED}]
                          [CRITERIA=criteria]
                          [MAXSEL={9999 | nnnn}]
                          [AUTOSEL={YES | NO}]’]
APPL=application id

A required parameter giving the application identifier of the list.

TYPE={PRIVATE | PUBLIC}

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

PUBLIC

Public list—available for general use

PRIVATE

Private list—owned by a specific user ID

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

USER=userid

An optional parameter (if TYPE is not PUBLIC) giving the user ID of the user owning the list. Default is the user ID of the user invoking the function.

NAME=list name

A required parameter giving the name of the list.

FORMAT={ACTION | MSELECT | SSELECT| NUMBERED}

An optional parameter indicating the format in which the list is to be displayed. Valid values are as follows:

ACTION

Action list

MSELECT

Multiple selection list

SSELECT

Single selection list

NUMBERED

Numbered list

The default is ACTION.

CRITERIA=criteria

A criteria statement used to select items to go in the list. The format must conform to that required by the service procedure specified in the list definition. If specified, this criteria overrides any criteria specified in the list definition, and no &$LHCRITnnnn variables can be set.

MAXSEL={9999 | nnnn}

The maximum number of items that can be chosen from a list in format MSELECT (multiple selection list). The default is 9999, and the range is 1 through 9999.

AUTOSEL={YES | NO}

Determines whether an entry in a list is automatically selected if it is the only entry in the list. The default is NO.

Input Variables

This statement contains the following input variables:

&$LHCRITnnnn

Criteria variables (up to 9999 variables can be given). Cannot be specified if the CRITERIA operand is specified. The format must conform to that required by the service procedure specified in the list definition.

Return Variables

This statement contains the following return variables:

&$LHENTTOTAL

The total number of entries selected (up to 9999).

&$LHENTIDnnnn

The IDs of the list entries selected.

&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

2

No data found

3

Canceled by exit

4

Canceled by user

8

Processing error

9

Return requested

10

Nesting level exceeded

11

Definition not eligible for processing

Example

The following statements display action list ZPRPRALL in the application identified by the ID ZPR. A private list is displayed in preference to a public list.

&CONTROL SHRVARS=($LH)
-EXEC $CACALL   OPT=ACTION +
                ACTION=DISPLAY +
                CLASS=LIST +
                NAME=‘?APPL=ZPR +
                NAME=ZPRPRALL +
                PARMS=‘FORMAT=ACTION’