z/OS TSO/E REXX User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Examples Using the ADDRESS Instruction

z/OS TSO/E REXX User's Guide
SA32-0982-00

ADDRESS Example 1

/****************************** REXX *******************************/
/* This exec must be run in ISPF.  It asks users if they know the  */
/* PF keys, and when the answer is a variation of "no", it displays*/
/* the panel with the PF key definitions.                          */
/*******************************************************************/
 SAY 'Do you know your PF keys?'

 PULL answer .
 IF answer = 'NO' | answer = 'N' THEN
    ADDRESS ispexec "display PANEL(ispopt3c)"
 ELSE
   SAY 'O.K. Never mind.'

ADDRESS Example 2

/****************************** REXX *******************************/
/* This exec must be run in ISPF.  It blanks out previous data set */
/* name information from the fields of an ISPF panel named newtool.*/
/* It then displays the panel to the user.                         */
/*******************************************************************/
 ADDRESS ispexec
 CALL blankem                       /* Call an internal subroutine */

 IF RC = 0 THEN
     "display PANEL(newtool)"
 ELSE
     "setmsg MSG(nt001)"                 /* Send an error message. */

 EXIT

 blankem:
   'vget (ZUSER)'
   ntgroup = '
   nttype = '
   ntmem = '
 RETURN RC

ADDRESS Example 3

/****************************** REXX *******************************/
/* This exec must be run in ISPF.  It displays panel named newtool */
/* and gets the name of a data set from input fields named ntproj, */
/* ntgroup, nttype, and ntmem.  If no member name is specified (the*/
/* data set is sequential) the data set name does not include it.  */
/* If a member name is specified, the member is added to data set  */
/* name.  The fully-qualified data set name is then inserted into a*/
/* TRANSMIT command that includes single quotation marks and the   */
/* destination, which was received from an input field named ntdest*/
/*******************************************************************/
 ADDRESS ispexec
 "DISPLAY PANEL(newtool)"

 ADDRESS tso      /* re-establish the TSO host command environment */
 IF ntmem = '' THEN                        /* member name is blank */
   DO
     dsname = ntproj'.'ntgroup'.'nttype
     "TRANSMIT" ntdest "DA('"dsname"')"
   END
 ELSE
   DO
     dsname = ntproj'.'ntgroup'.'nttype'('ntmem')'
     "TRANSMIT" ntdest "DA('"dsname"')"
   END

ADDRESS Example 4

To link to or attach a logoff routine named MYLOGOFF and pass it the level of TSO/E installed, you can issue the following instructions from an exec.
ADDRESS LINK 'MYLOGOFF' SYSVAR(SYSTSOE)
or
ADDRESS ATTACH 'MYLOGOFF' SYSVAR(SYSTSOE)

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014