LIST

LANSA Integrator

LIST

The LIST command is used to obtain a list of spool files from the specified output queue.

 

                                                           Required

 

 LIST ---- LIBRARY ------ library name --------------------------->

 

       >-- QUEUE -------- output queue --------------------------->

 

                                                           Optional

 

       >-- USER --------- *ALL ----------------------------------->

                          user ID

 

       >-- USERDATA ----- *ALL ----------------------------------->

                          userdata

 

       >-- FORMTYPE ----- *ALL -----------------------------------|

                          formtype

 

Keywords

LIBRARY

A valid IBM i library name must be supplied.

 

QUEUE

A valid IBM i output queue must be supplied.

 

SERVICE_LIST

Only required for RDML clients.

The LIST command requires a working list with six or ten fields to receive the spool file information.

The fields can be of any name and size, it is the sequence of the fields that is important. The SERVICE_LIST field sequence, size and type must match the fields defined in the DEF_LIST included in the return keywords.

NAME      The name of the spool file.

NUMBER    The spooled file number of the specified file.

JOBNAME   The name of the job that created the spooled file.

JOBUSER   The name of the user who produced the spooled file.

JOBNUMBER The number of the job in the system.

STATUS    Status of spool file.

PAGES     Page count.

DATE      Creation date (YYYY-MM-DD).

TIME      Creation time (HH:MM:SS).

USERDATA  User data.

 

Refer to Reserved Keywords for your appropriate JSM Client for more information.

 

USER

Indicates that only spool files with a JOBUSER matching this USER should be returned.

This should be a valid IBM i User ID or *ALL.

USERDATA

Indicates that only spool files matching the USERDATA specified should be returned.

The default value is *ALL

FORMTYPE

Indicates that only spool files matching the FORMTYPE specified should be returned.

This should be a valid IBM i spool file FORMTYPE (e.g. *STD) or *ALL.

Comments / Warnings

Use the USER, USERDATA and FORMTYPE filters to limit the amount of spool files returned.

Examples

RDML

Using RDML the SERVICE_LIST keyword is required to provide appropriate fields for each column in the working list to be returned.

 

DEF_LIST NAME(#SPOOLLST) FIELDS(#FLENAM #FLENUM #JOBNAME #JOBUSER #JOBNUMBER #SPLFILSTS) COUNTER(#LISTCOUNT) TYPE(*WORKING) ENTRYS(0009999)

USE BUILTIN(TCONCAT) WITH_ARGS('LIST LIBRARY(' #JSMLIB ') QUEUE(' #JSMOUTQ ') USER(') TO_GET(#JSMCMD)

 

USE BUILTIN(TCONCAT) WITH_ARGS('LIST LIBRARY(' #JSMLIB ') QUEUE(' #JSMOUTQ ') USER(') TO_GET(#JSMCMD)

 

IF COND('#JSMUSER *NE *BLANK')

USE BUILTIN(TCONCAT) WITH_ARGS(#JSMCMD #JSMUSER) TO_GET(#JSMCMD)

ELSE

USE BUILTIN(TCONCAT) WITH_ARGS(#JSMCMD '*ALL') TO_GET(#JSMCMD)

ENDIF

 

USE BUILTIN(TCONCAT) WITH_ARGS(#JSMCMD ') USERDATA(*ALL) FORMTYPE(*STD) SERVICE_LIST(' 'FLENAM, FLENUM, JOBNAME, JOBUSER, JOBNUMBER, ' 'SPLFILSTS)') TO_GET(#JSMCMD)

 

USE BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG #SPOOLLST)

EXECUTE SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)

 

RDMLX

Using RDMLX the working list does not need to be explicitly described to the JSM service (like RDML) as the LANSA compiler automatically determines the structure of the working list nominated on the returned arguments.

 

Def_list name(#spoollst) fields(#file name #filenumber #jobname #jobuser jobnumber #status) type(*working) entrys(500)

 

#jsmcommand := 'LIST LIBRARY(QUSRSYS) QUEUE(' + #JSMOUTQ + ') USER(' + #JSMUSERID + ') USERDATA(*ALL) FORMTYPE(*STD)'

 

use builtin(jsmx_command) with_args(#jsmxhdle1 #jsmcommand) TO_GET(#jsmxsts #jsmxmsg #spoollst)