z/OS ISPF Edit and Edit Macros
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Experimenting with macro commands

z/OS ISPF Edit and Edit Macros
SC19-3621-00

Use the ISRTRYIT macro (Figure 1) to experiment with edit macros. ISRTRYIT is handy when you want to see how a command or assignment statement works but do not actually want to write an entire macro. ISRTRYIT processes the command and issues return codes that show whether it succeeded. To start the macro, type ISRTRYIT on the command line, followed by a command, and press Enter. If you enter ISRTRYIT with the RESET operand, the variable &COMMAND is set to RESET; if you enter it as ISRTRYIT FIND A, the variable &COMMAND is set to FIND A.

Figure 1. ISRTRYIT macro
/*********************************************************************/
/*                                                                   */
/* 5647-A01 (C) COPYRIGHT IBM CORP 1995, 2003                        */
/*                                                                   */
/* ISRTRYIT - a simple macro for trying out edit macro statements.   */
/*                                                                   */
/*********************************************************************/
ISREDIT MACRO (COMMAND)
  SET &RETCODE = 0                     /* Initialize return code  */
  IF &STR() = &STR(&COMMAND) THEN      /* If no command specified */ -
    WRITE MISSING COMMAND PARAMETER    /*   indicate problem      */
  ELSE DO                              /* Else parameter exists;  */
    ISREDIT &COMMAND                   /* Invoke edit command,    */
    SET &RETCODE = &LASTCC             /*   save the return code  */
    WRITE &COMMAND RETURN CODE IS &RETCODE  /*   and display it   */
  END                                  /*   and the command name  */
EXIT CODE(&RETCODE)

The ISRTRYIT macro tests both the SEEK and AUTONUM commands (Figure 2). When you run the macro, it displays the return codes from the commands on your screen (Figure 3).

Figure 2. ISRTRYIT macro - before running
   File  Edit  Edit_Settings  Menu  Utilities  Compilers  Test  Help
 ───────────────────────────────────────────────────────────────────────────────
 EDIT       SBURNF.PRIVATE.DATA(TESTDATA) - 01.00           Columns 00001 00072
 Command ===> isrtryit seek "test"; isrtryit autonum on        Scroll ===> CSR 
 ****** ***************************** Top of Data ******************************
 000100 TEST-#
 000200 TEST-#
 000300 TEST-#
 000400 TEST-#
 000500 TEST-#
 000600 TEST-#
 000700 TEST-#
 000800 TEST-#
 000900 TEST-#
 001000 TEST-#
 001100 TEST-#
 001200 TEST-#
 001300 TEST-#
 ****** **************************** Bottom of Data ****************************



  F1=Help      F2=Split     F3=Exit      F5=Rfind     F6=Rchange   F7=Up
  F8=Down      F9=Swap     F10=Left     F11=Right    F12=Cancel
Figure 3. ISRTRYIT macro - after running
 ISREDIT SEEK "TEST"
 RETURN CODE IS 0
 ISREDIT AUTONUM ON
 RETURN CODE IS 0
  ***_

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014