Showing posts with label TSO commands. Show all posts
Showing posts with label TSO commands. Show all posts

Monday, 11 March 2013

TSO EXEC and EXECUTIL command


EXEC:

EXEC is used to explicitly execute a CLIST or REXX(also called as EXECs) exec.
CLIST and REXX can be executed implicitly if the libraries containing the CLIST and REXX are assigned to the DDNAMEs SYSPROC or SYSEXEC.

For "shortnames", the last qualifier must be CLIST and must be omitted

EXEC 'fullname(member)' 'parameters'
EXEC 'fullname(member)' 'parameters' CLIST
EXEC shortname(member) 'parameters'
EXEC shortname(member) 'parameters' CLIST

For "shortnames", the last qualifier must be EXEC and must be omitted; for the two examples without the "EXEC" keyword at the end, the first line of the exec must contain a comment containing the word REXX (/*REXX*/):

EXEC 'fullname(member)' 'parameters'
EXEC 'fullname(member)' 'parameters' EXEC
EXEC shortname(member) 'parameters'
EXEC shortname(member) 'parameters' EXEC

·  The 'parameters' may be omitted from the command line if no parameters are to
be passed to the CLIST or REXX exec.
·  The CLIST keyword at the end of the command line should only be specified for
CLISTs.
·  The EXEC keyword at the end of the command line should only be specified for
REXX execs.


Implicitly calling CLIST or EXEC:

CLISTs and REXX execs may be executed implicitly.
While calling the CLIST or REXX(EXEC) implicitly the EXEC command is not used , instead
member name of the exec is used as if it were a command.
This requires that the CLIST or REXX execs reside in libraries which are assigned to the
ddnames SYSPROC or SYSEXEC.

The libraries assigned to SYSPROC may contain CLISTS and/or REXX execs.
The libraries assigned to SYSEXEC may contain only REXX execs.

The record format of the libraries may be fixed (F B) or variable (V B), but must match the record format of any existing libraries already assigned to the ddname. The record length may be up to 255 for fixed format or 259 for variable format, but for fixed format the record length must match any existing libraries already assigned to the ddname.

SYSPROC is pre-allocated to numerous system libraries. If you add any
libraries to SYSPROC, be sure to include the existing system libraries when reallocating
SYSPROC.

SYSEXEC may be pre-allocated to various system libraries. If you add any
libraries to SYSEXEC, be sure to include the existing system libraries when reallocating
SYSEXEC. All libraries allocated to SYSEXEC should match in record format (and
record length for fixed format).

Also, SYSEXEC will not be searched for any REXX execs unless SYSEXEC searching is activated.
This is done by using the command EXECUTIL.

Following is the syntax for executing the CLIST or REXX implicitly

membername parameters

OR

%membername parameters

The parameters are optional and may be omitted.

% -->   The system normally checks several libraries before the exec libraries; the % informs the system to check only the exec libraries. The %is optional and may be omitted; however, use of % results in slightly improved performance.



EXECUTIL TSO command:

EXECUTIL determines whether or not the ddname SYSEXEC is searched for implicit
execs. By default, only the ddname SYSPROC is searched for implicit execs. (SYSEXEC
may contain only REXX execs; SYSPROC may contain CLISTS and REXX execs.)
EXECUTIL may be executed at any time to activate or deactivate searching of
SYSEXEC.

Turn searching on: EXECUTIL SEARCHDD(YES)
Turn searching off: EXECUTIL SEARCHDD(NO)

TSO CALL command


TSO CALL command:

Used to execute a Load Module- Binary executable form of program which was previously link edited.

If the first qualifier of the data set name containing the load module does not match your PREFIX (typically your userid) or if the last qualifier is not LOAD, the data set name must be fully qualified and enclosed within single quotes on the command line.

Syntax:
CALL 'fullyqualfiedname(loadmodulename)' 'parameters'

Example:

CALL 'cmn.test.baso.lod(mytest1)' 'X,0,CCCC'

The above call function will call the program mytest1. We are also passing parameters to the program.
If the program uses input and output files the program will fail while opening the file as we have not allocated any datasets. This can be done using the ALLOCATE or ALLOC command prior to calling the program.

If the program needs a Input file to be associated with a ddname INPUT1, then following is how we execute the program

ALLOCATE DDNAME(INPUT1) DSN('sm107r.test.input') SHR
CALL 'cmn.test.baso.lod(mytest1)' 'X,0,CCCC'

 FROM HELP:
 FUNCTION                                                                 
   The CALL command loads and executes programs in executable form.       
                                                                          
 SYNTAX -                                                                 
                                                                          
          CALL   'dsname(member)' 'parm'                                  
                 CAPS/ASIS   NOENVB/PASSENVB                              

Defaults:
MEMBER - If no MEMBER is specified, TEMPNAME is used.     
CAPS   - the PARM parameter string is to be translated to uppercase.                                         
NOENVB - The REXX environment block address is not to be passed to the program in register 0.               
                                                            
Operands:
CAPS     The CAPS operand indicates that the parameter string
     'PARM' is to be translated to uppercase before the called program executes.       This is the default.                
                                                                       
ASIS     The ASIS operand indicates that the parameter string          
         'PARM' should not be translated to uppercase before           
         the called program executes.                                  
                                                                       
NOENVB   The NOENVB operand indicates that the REXX environment        
         block (ENVBLOCK) address is not to be passed to the called    
         program in register 0.  This is the default.                  
                                                                       
PASSENVB The PASSENVB operand indicates that the REXX environment      
         block (ENVBLOCK) address is to be passed to the called        
         program in register 0.                                        

dsname(member) - The name of a partitioned data set and the member which     
           is to be executed                                           

'parm'   - Specifies a parameter string (up to 100 characters)         
           that is passed to the program to be executed.