Exec basics

Procedure

In a very simple REXX exec, you might do the following:

  1. Add the SDSF host command environment.
    rc=isfcalls('ON')
  2. Access a panel with "ISFEXEC panel-command". This creates stem variables for each row and column on that panel. To access the Status panel, you could use:
    Address SDSF "ISFEXEC ST"
  3. Find the job you want to work with by examining the JNAME stem variables created for the JOBNAME column. (You refer to columns not by their titles, but by the same names that you would use in defining a field list in ISFPARMS. See z/OS SDSF Operation and Customization.)
    do ix=1 to JNAME.0    /* Loop for all rows returned */            
      if pos("RJONES",JNAME.ix) = 1 then                            
  4. Take an action or modify a value for the job with "ISFACT operands".
    operands is made up of:
    • The panel command that you used previously with ISFEXEC
    • A TOKEN.number variable that was created by the ISFEXEC command and identifies the row that represents the job
    • Parameters that define the action or modification. In this example, you supply the P action character in the NP column to cancel the job.
        Address SDSF "ISFACT ST TOKEN('"TOKEN.ix"') PARM(NP P)"      
  5. Delete the host command environment (after closing the do loop).
    end           
    rc=isfcalls('OFF')                                                

What to do next

Of course, in an actual exec, you would have more complex logic and error checking. This would require the use of special REXX variables to do things like examine messages issued, filter rows on the panel, and define the columns to include. For more examples, see Examples of REXX execs.