JCL Session 11



CLISTS (Command List)



Possible uses for a CLIST



MYCLIST is a member of CCPR00.CCP.CLIST

Contents of MYCLIST:  HELP


Four modes of starting a CLIST::
 
Mode TSO Command Syntax Example
Explicit EXEC/EX  
  • followed by 'complete name of dataset' within single quote marks
EX 'CCPR00.CCP.CLIST(MYCLIST)'
Modified explicit EXEC/EX  
  • followed by middle names of dataset -- if any 
  • use (member_name) at end

  •   
    the system adds userid at beginning  
    & 'clist' at end 

    The example on the right refers to the same dataset as the example for the Explicit command reference. 

EX CCP(MYCLIST)
Implicit member_name  
 
    SYSPROC is searched for the member_name  

    To use this type of command 

  • Allocate clist library to SYSPROC 
  • Issue commands by stating the name of a member. 
    (Potential conflicts with actual TSO commands) 
 
MYCLIST
Modified implicit %member_name  
    SYSPROC is searched for the member_name  

    (Avoids potential conflicts with actual TSO commands)

%MYCLIST
 



Some Useful TSO COMMANDS
 
 
TSO HELP lists tso commands available 
TSO HELP LISTALC list more details about LISTALC command 
LISTALC STATUS  list the datasets allocated to a user 
 



Setup for using CLIST in your TSO Environment


 

Allocating a file with CLIST


 

Allocating Print resources



Abbreviate commands by truncation
Command still works as long as uniqueness is preserved



Allocate command with completely spelled parameters



Allocate command with abbreviated parameters



CLIST's START PROGRAMS WITH A 'CALL' STATEMENT



RETURN CODES



FREE Resources because

FREE resources in order to

FREE anything previously ALLOCATE 'ed

Example:



Example CLIST to execute IEBGENER
------------------------------------------------------------------------------------------------------------------

CLIST to execute PARMPLUS



 

CLIST VARIABLES




SET command assigns values to a CLIST variable



ARITHMETIC Commands



Logical operators


 
Operator Test
EQ Equal
NE Not Equal
LT Less Than
GT Greater Than
LE Less Than or Equal To
GE Greater Than or Equal To
AND Connects conditions
OR Disassociates conditions
 



Sample Relational statement

IF (&A GE 10) OR ((&B LT 5) AND (&C GT 9)) THEN etc.



CHARACTER OPERATIONS


Concatenation Example



&STR – tells tso to treat the subsequent variables as character data



More String Commands
 
COMMAND ACTION
&EVAL evaluate variables and do computations
&SUBSTR(1st_char,last_char,string) extract a substring
&LENGTH(string) returns length of a string
&SYSCAPS(string) converts a string to caps
&SYSLC(string) converts a string to lower case
&SYSINDS(string_sought,string_searched,start_column) returns 0 if not found, position if found
 



SELECTION STATEMENTS:
------------------------------------------------------------------------------------------------------------------

BRANCHING STATEMENT: GOTO


GOTO label
 

Terminating a CLIST


   

DO groups execute several statements instead of one



Looping control


 
    DO WHILE expression 
      statements
    END 
    DO UNTIL expression 
      statements
    END 
    DO variable = FROM expression TO to_expression BY adder 
       
      statements
    END 
 
 


TERMINAL I/O



 
Command Function
WRITE  Writes a string of constants and variables and then places cursor on next line 
WRITENR  Writes string and leaves cursor at end of line written at terminal 
READ &variable  Retrieves input from the terminal until user presses ENTER 

FILE I/O



 

FILE testing




CLIST SYSTEM Variables


 
Variable Name Contents
&SYSUID  Contains user id of the current TSO session 
&SYS4DATE  Date as mm/dd/yyyy 
&SYS4SDATE  Date as yyyy/mm/dd 
&SYSTIME  Time as hh:mm:ss 

CLIST CODING RULES




Externally Halting CLIST execution:



CLIST PROC statement

        is used to communicate variable information to a CLIST being invoked.



Required variables are defined as positional parameters
Optional variables are defined as keyword parameters

If a PROC statement exists in a CLIST, then the syntax is

POSITIONAL PARAMETERS



If not supplied when the CLIST is called, the system will prompt with

KEYWORD PARAMETERS



KEYWORD PARAMETERS EXAMPLE:



MODIFIED KEYWORD PARAMETERS


Keywords on the PROC without a value will pass the name of the variable itself or a value of spaces.

CLIST EXERCISE (VALUE 30 points)

 


INSTRUCTIONS FOR EMAILING MAINFRAME ASSIGNMENTS TO INSTRUCTOR:

1) Logon to SHRIKE.

2) At the prompt type ftp moses

3) When asked for a name, type your mainframe login id ccp#%%

4) When asked for a Password, type your mainframe login password

5) At the ftp> prompt, type cd clist

6) type get PGMWPARM

7) At the next ftp> prompt, type quit

8) $ mail jpetlick@condor.depaul.edu < PGMWPARM