LISTJOB – List job attributes from the database

Use LISTJOB to display the job attributes from the database. These can include the applications where the job is coded, the operation level details, including Special Resources and User Fields, and dependencies, including internal and external predecessors and successors.

LISTJOB <jobname> [ADID(<adname>)] [DETAIL(APPL|OPER|SUCC)]
                  [DISPLAY(YES|NO)]
                  [FLOW(n)] [GROUPDEF(<application-group>)] 
                  [GROUP(<authority-group>)] [MULTI(ALL|FAIL|FIRST|LAST)]
                  [IGNORE(=ALL,=NONE,=FIRST,=LAST,=<wstype>,<wsname>,<opno>)]
                  [OBJECT(<object>)] [OPNO(nnn)] [OUTPUT(*|<ddname>)]
                  [OWNER(<owner>)][PRIORITY(n)] [SAVELIST(<savelist>)] 
                  [STATUS(A|P|*)] [STYLE(TEXT|LOADER)]
                  [VALFROM(yymmdd)] [VALID(yymmdd)] [VALTO(yymmdd)]
                  [WSNAME(<wsid>)]
where:
The first positional parameter
The job name to find.
ADID
A filter field to restrict the search to the application specified. Wildcards are allowed.
DETAIL
How much detail to return. APPL lists only the applications in which the job is found. OPER also lists the operation attributes, extended information, automation information, special resources, dependencies, conditional dependencies, and user fields. SUCC lists external successors.
DISPLAY
Whether to generate the output to SYSTSPRT.
FLOW
The column width at which one line of output flows to another. If not specified, the data will flow appropriate to the length of the output stream.
GROUPDEF
A filter field to restrict the search to the members of the application group specified. Wildcards are allowed.
GROUP
A filter field to restrict the search to the authority group specified. Wildcards are allowed.
IGNORE
A list of elements that define the internal dependencies to be ignored when listing the dependencies of the job. The default is =FIRST =LAST to ignore the internal dependencies to the first and last operations. The default is set by OPTIONS IGNORE.
You can combine the following arguments:
=ALL
Ignore all internal dependencies.
=NONE
Do not ignore any internal dependencies.
=FIRST
Ignore the first operation (as defined by OPTIONS FIRST).
=LAST
Ignore the last operation (as defined by OPTIONS LAST).
<wstype>
Ignore the operations that use a specific workstation type. Valid types are: AUTO, CPU, DUMMY, PRINT, REMOTE-D, REMOTE-Z, SETUP, STC, VIRTUAL, WAIT, WTO, or ZCENTRIC.
<wsname>
Ignore the operations that use a specific workstation.
<opno>
Ignore the operations on a specific operation number.
MULTI
Specifies what to do if the job is found more than once:
ALL
Reports all places found.
FAIL
Ends with RC=8, if more than one match is found.
FIRST
Reports only the first place found.
LAST
Reports only the last place found.
SAVELIST and OBJECT always return all matches.
OBJECT
Sets an object variable in which to store all the attributes.
OPNO
A filter field to restrict the search to the operation number specified in this keyword.
OUTPUT
Sets an output destination for display style output, either * to output to the stack, or a DD statement.
OWNER
A filter field to restrict the search to applications with the specified owner ID. Wildcards are allowed.
SAVELIST
Saves the record selection criteria for each application containing the job to a specified list.
STATUS
A filter field to restrict the search to applications with a specific status:
A
Active applications.
P
Pending applications.
*
All applications (default).
STYLE
The output style:
TEXT
Uses descriptive text to identify each record.
LOADER
Uses batch loader keywords to identify each record.
VALFROM
A filter field to restrict the search to applications matching the valid from date specified. Wildcards are allowed.
VALID
A filter field to restrict the search to applications that are valid on the date specified. Wildcards are allowed.
VALTO
A filter field to restrict the search to applications matching the valid to date specified. Wildcards are allowed.
WSNAME
A filter field to restrict the search to applications containing the specified workstation. Wildcards are allowed.

For example, LISTJOB JOB040 lists all the applications in which JOB040 is contained.

The following example is a simple list of applications containing JOB040:
Application: ADID(CMDDEMO3) ADVALFROM(141024) DESCR('Demonstrate CMD1 WS')    
             OWNER(TWS)                                                       
Application: ADID(DEEPFROG1) ADVALFROM(141030) DESCR('Demonstrate CMD1 WS')   
             OWNER(TWS)                                                       
Application: ADID(DROPTEST) ADVALFROM(140922) DESCR('Test DROP command')      
             OWNER(TWS)                                                       
Application: ADID(DROPTEST2) ADVALFROM(140924) DESCR('Test DROP command')     
             OWNER(TWS)                                                       
The command LISTJOB JOB005 ADID(DEEPFROG6) DETAIL(SUCC) lists all details of JOB005 as defined in application DEEPFROG6:
Application: ADID(DEEPFROG6) ADVALFROM(141102) DESCR('Demo RUNIF') OWNER(TWS)   
  Operation: WSID(CPU1) OPNO(005) JOBN(JOB005) DURATION(1) HIGHRC(00000006)     
             STARTTIME(2100) R1NUM(00000002) R2NUM(00000004) FORM(ABD00123)     
             TIME(Y) CRITICAL(P)                                                
    Predecessor-INT: WSLCCMD1 PREADID(DEEPFROG6) PREWSID(CMD1) PREOPNO(001)     
    Predecessor-EXT: ZLAST  PREADID(DEEPFROG4) PREWSID(NONR) PREOPNO(255)       
                     PRECSEL(R) PREMAND(C)                                      
    Resource: RESOURCE(JOHN) USAGE(X)                                           
    User field: UFNAME(EQQ-SYSIN-01) UFVALUE('VARSUB SCAN(!)')                  
    User field: UFNAME(EQQ-SYSIN-02) UFVALUE('SHO OPTIONS')                     
    Ext criteria: ADID(DEEPFROG4) WSID(NONR) OPNO(255) TYPE(R) TOWHEN(B)        
                  TOHHH(000) TOMM(01)                                           
    Successor-INT: JOB010 SUCADID(DEEPFROG6) SUCWSID(CPU1) SUCOPNO(010)         
    Successor-INT: JOB020 SUCADID(DEEPFROG6) SUCWSID(CPU1) SUCOPNO(020)         
    Successor-EXT: WSLCCMD1 SUCADID(DEEPFROG5) SUCWSID(CMD1) SUCOPNO(001)

The output from LISTJOB is similar to Batch Loader, though not directly executable as Batch Loader. The fields shown are the fields that are not set to their default values, and the values themselves are stripped of trailing spaces.

For the DISPLAY output, each segment type is shown as descriptive labels.

For the OBJECT output, the Batch Loader command name prefixes each record, with the exception of dependencies. The OBJECT structure includes a record counter contained in the high level object variable and a record for each segment of output. The following command:
VARSUB SCAN(!) 
LISTJOB JOB005 DETAIL(SUCC) OBJECT(FREDDO) DISPLAY(N) MULTI(FAIL) 
        ADID(DEEPFROG6) 
DO X = 1 TO !@FREDDO 
   DISPLAY @V(@FREDDO-!X.) 
END 
returns the following OBJECT output:
ADSTART ADID(DEEPFROG6) ADVALFROM(141102) DESCR('Demo RUNIF') OWNER(TWS)
ADOP WSID(CPU1) OPNO(005) JOBN(JOB005) DURATION(1) HIGHRC(00000006) STARTTIME(2100)  
R1NUM(0000002) R2NUM(0000004) FORM(ABD0123) TIME(Y) CRITICAL(P) TIME(Y) CRITICAL(P)
ADPRE-INT WSLCCMD1 PREADID(DEEPFROG6) PREWSID(CMD1) PREOPNO(001)                
ADPRE-EXT ZLAST  PREADID(DEEPFR4) PREWSID(NONR) PREOPNO(255) PRECSEL(R) PREMAND(C)
ADSR RESOURCE(JOHN) USAGE(X)                                                    
ADUSF UFNAME(EQQ-SYSIN-01) UFVALUE('VARSUB SCAN(!)')                             
ADUSF UFNAME(EQQ-SYSIN-02) UFVALUE('SHO OPTIONS')                               
ADXIV ADID(DEEPFROG4) WSID(NONR) OPNO(255) TYPE(R) TOWHEN(B) TOHHH(000) TOMM(01)
ADSUC-INT JOB010 SUCADID(DEEPFROG6) SUCWSID(CPU1) SUCOPNO(010)                  
ADSUC-INT JOB020 SUCADID(DEEPFROG6) SUCWSID(CPU1) SUCOPNO(020)
ADSUC-EXT WSLCCMD1 SUCADID(DEEPFROG5) SUCWSID(CMD1) SUCOPNO(001)

The exception to Batch Loader format is how dependencies are presented. The database works only with predecessors, but LISTJOB shows also successor relationships for each job. Instead of ADDEP, the dependencies are represented by ADPRE and ADSUC with -INT or -EXT appended to show whether the dependency is internal or external. The application name is shown, even for internal dependencies, so that the ADDJOB function can use this to resolve relationships. Also in an exception to the Batch Loader convention the job name is listed as the first word on any ADPRE or ADSUC record.