GET-Examples


In this example scenario, an object has the following four start commands defined:

  • S AAO,JOBNAME=&@STCNAME
  • START AAO,JOBNAME=&@STCNAME
  • START OBJECT=&@STCNAME
  • F NONCMD,START OBJECT=ONE

The following example shows how to use the GET function in an EXEC to obtain the text and other attributes for each of these commands that can be used in other EXECs:

/* REXX--------------------------------------------------------*/       
/*                                                             */       
/* A sample EXEC that will get the start commands for a        */       
/* particular object in the active definition base.  The name  */       
/* of that object comes from the input parameters for this     */       
/* EXEC.                                                       */       
/*                                                             */       
/*-------------------------------------------------------------*/       
PARSE UPPER ARG EXECNAME OBJNAME FILLER                                 

DROP LINE.                                                              

'TOMEXEC FUNC(GET) OBJECT(''OBJNAME'') STEM(LINE)

'IMFEXEC MSG 'Return code for GET is 'TOMRC'''                          

/*-------------------------------------------------------------*/       
/*                                                             */       
/* This section will report on any exception messages issued   */       
/* by the GET function that was just issued.                   */       
/*                                                             */       
/*-------------------------------------------------------------*/       
IF (TOMRC /= 0) THEN                                                    
  DO I=1 TO LINE.EXCEPT.0                                               
   'IMFEXEC MSG ''LINE.EXCEPT.I'''                                      
  END                                                                   

/*-------------------------------------------------------------*/       
/*                                                             */       
/* This section will issue messages that will show the start   */       
/* command attributes that were returned by the successful     */       
/* GET function.                                               */       
/*                                                             */       
/*-------------------------------------------------------------*/       
IF (TOMRC = 0) THEN                                                     
  DO                                                                    
    DO I = 1 TO LINE.START.0                                            
      'IMFEXEC MSG 'Start Command                #'||,
      I LINE.START.I.CMD'''                           
      'IMFEXEC MSG 'Start Command Type           #'||,
      I LINE.START.I.TYPE'''                          
      'IMFEXEC MSG 'Start Command Description    #'||,
      I LINE.START.I.DESCR'''                         
      'IMFEXEC MSG 'Start Command Timeout        #'||,
      I LINE.START.I.TIMEOUT'''                       
    END                                               
  END                                                 

'IMFEXEC EXIT CODE('TOMRC')'

After the EXEC completes, if it was scheduled from MainView AutoOPERATOR, the following output is written to the BBI-2 journal:

Return code for GET is 0                                     
Start Command                #1 S AAO,JOBNAME=&@STCNAME      
Start Command Type           #1 MVS                          
Start Command Description    #1 Start Command #1             
Start Command Timeout        #1 30                           
Start Command                #2 START AAO,JOBNAME=&@STCNAME  
Start Command Type           #2 MVS                          
Start Command Description    #2 Start Command #2             
Start Command Timeout        #2 10                           
Start Command                #3 START OBJECT=&@STCNAME       
Start Command Type           #3 EXEC                         
Start Command Description    #3 Start Command #3             
Start Command Timeout        #3 60                           
Start Command                #4 F NONCMD,START OBJECT=ONE    
Start Command Type           #4 MVS                          
Start Command Description    #4 Start Command #4             
Start Command Timeout        #4 300

Note that start commands 1, 2, and 3 all returned the unresolved '&@STCNAME' variable. To return the resolved values for the &@STCNAME variable, specify the REALTIME parameter to the GET function statement:

'TOMEXEC FUNC(GET) OBJECT(''OBJNAME'') STEM(LINE) REALTIME'

The following shows the output of the EXEC and the values for the ‘&@STCNAME’ variable are resolved:

Return code for GET is 0                                     
Start Command                #1 S AAO,JOBNAME=MAMKZ010       
Start Command Type           #1 MVS                          
Start Command Description    #1 Start Command #1             
Start Command Timeout        #1 30                           
Start Command                #2 START AAO,JOBNAME=MAMKZ010   
Start Command Type           #2 MVS                          
Start Command Description    #2 Start Command #2             
Start Command Timeout        #2 10                           
Start Command                #3 START OBJECT=MAMKZ010        
Start Command Type           #3 EXEC                         
Start Command Description    #3 Start Command #3             
Start Command Timeout        #3 60                           
Start Command                #4 F NONCMD,START OBJECT=ONE    
Start Command Type           #4 MVS                          
Start Command Description    #4 Start Command #4             
Start Command Timeout        #4 300

You can also specify the REALTIME parameter when a model object is associated with the object. In another example, a model object is defined with the following commands:

  1. S COMMAND=ONE
  2. S COMMAND=TWO
  3. S COMMAND=THREE
  4. S COMMAND=FOUR
  5. S COMMAND=FIVE

The following shows the output from the EXEC when the REALTIME parameter is not specified with the GET function:

Return code for GET is 0                                     
Start Command                #1 S AAO,JOBNAME=&@STCNAME      
Start Command Type           #1 MVS                          
Start Command Description    #1 Start Command #1             
Start Command Timeout        #1 30                           
Start Command                #2 START AAO,JOBNAME=&@STCNAME  
Start Command Type           #2 MVS                          
Start Command Description    #2 Start Command #2             
Start Command Timeout        #2 10                           
Start Command                #3 START OBJECT=&@STCNAME       
Start Command Type           #3 EXEC                         
Start Command Description    #3 Start Command #3             
Start Command Timeout        #3 60                           
Start Command                #4 F NONCMD,START OBJECT=ONE    
Start Command Type           #4 MVS                          
Start Command Description    #4 Start Command #4             
Start Command Timeout        #4 300

When the REALTIME parameter is specified with the GET function statement, the output contains the resolved variable values:

Return code for GET is 0                                  
Start Command                #1 S AAO,JOBNAME=MAMKZ010    
Start Command Type           #1 MVS                       
Start Command Description    #1 Start Command #1          
Start Command Timeout        #1 30                        
Start Command                #2 START AAO,JOBNAME=MAMKZ010
Start Command Type           #2 MVS                       
Start Command Description    #2 Start Command #2          
Start Command Timeout        #2 10                        
Start Command                #3 START OBJECT=MAMKZ010     
Start Command Type           #3 EXEC                      
Start Command Description    #3 Start Command #3          
Start Command Timeout        #3 60                        
Start Command                #4 F NONCMD,START OBJECT=ONE
Start Command Type           #4 MVS                       
Start Command Description    #4 Start Command #4          
Start Command Timeout        #4 300                       
Start Command                #5 S COMMAND=FIVE            
Start Command Type           #5 MVS                       
Start Command Description    #5 Model Start Command #5    
Start Command Timeout        #5 30

Also in this example, the first four commands are from the selected object’s definition. The fifth command is the fifth command for the associated model object. It has been merged with the commands from the selected object's definition.

In most cases, you should specify the REALTIME parameter in the EXEC to see the resolved attributes for the object’s variable values. If you do not need the variable values and inherited model attributes, you do not need to specify the REALTIME parameter.

The following example shows the syntax for the GET function:

 

TOMEXEC FUNC(GET) OBJECT(VALOBJ1) STEM(LINE)  TOMID(TOMV2) DEFBASE(DEFAULT) SYSPLEX(BBPLEX01)
TOMEXEC FUNCTION(GET) TOMID(TOMV2) SYSPLEX(BBPLEX01) STEM(LINE) SYSLAYER(VALSYSLAYER1)
TOMEXEC FUNCTION(GET) TOMID(TOMV2) SYSPLEX(BBPLEX01) STEM(LINE) PLEXLAYER(VALPLEXLAYER1)
TOMEXEC FUNCTION(GET) TOMID(TOMV2) SYSPLEX(BBPLEX01) STEM(LINE) LAYERPLEX(VALLYPX1)
TOMEXEC FUNCTION(GET) TOMID(TOMV2) SET(VALSET01) SYSPLEX(BBPLEX01) STEM(SET)
TOMEXEC FUNC(GET) TOMID(TOMV2) STEM(CAL) DAY(VALWED) SYSPLEX(BBPLEX01)
CALBASE(DEFAULTCAL)
TOMEXEC FUNC(GET) TOMID(TOMV2) STEM(CAL) TIME(SHIFT1) SYSPLEX(BBPLEX01)
CALBASE(DEFAULTCAL)
TOMEXEC FUNC(GET) TOMID(TOMV2) STEM(CAL) PERIOD(PER1) SYSPLEX(BBPLEX01)
CALBASE(DEFAULTCAL)
TOMEXEC FUNC(GET) TOMID(TOMV2) STEM(CAL) CALSET(VALCALSET1) SYSPLEX(BBPLEX01)
CALBASE(DEFAULTCAL)
TOMEXEC FUNC(GET) TOMID(TOMV2) STEM(CALBASE) CALBASE(VALCALBASE9) SYSPLEX(BBPLEX01)

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*