Skip to main content

LMAC V1.14 tool: Seamless ISPF edit line macros

 Downloadable files
 
Abstract
LMAC allows you to run user-written line commands in the ISPF editor without having to enter an additional command or assign each new command to a PF key.
 
Download Description
The ISPF editor has allowed you to write your own line commands (sometimes called prefix commands) for a long time. However, those line commands were only recognized when you also typed a macro name on the command line. As a result, edit line commands are not ‘seamless’ and not many line command edit macros have been written. People who do use them, often end up assigning a program function key to the name of each edit line command macro that they use.

LMAC is a tool developed internally within IBM that provides seamless edit line commands. It allows you to run line command macros without entering another command on the command line and without giving up any PF keys.

You must enter the LMAC command once during the ISPF session to enable line macros. This can be done automatically by specifying !LMAC as an initial macro or by invoking the command ISREDIT !LMAC within an initial macro. On the ISPF command line, type TSO LMAC to customize the name of the macro that gets invoked, otherwise the default is LINEMAC.

When you press the Enter key in ISPF Edit, LMAC scans the screen looking for line commands that the editor doesn’t support. If a command is found in the line command area that the editor won’t recognize, LMAC puts the name of an edit macro on the command line before the ISPF editor examines the screen. As a result, ISPF invokes this macro to handle the line command. LMAC can accept a list of commands to search for or it can pass all unrecognized line commands to your macro.

All line commands will be processed by the same macro. The macro receives the name of the command as a parameter. Because edit macros can call other edit macros, LINEMAC can be written as a small command routing program that simply calls other existing macros.

Note: You cannot use LMAC to override built-in line commands.

The following Rexx sample of using LMAC is available in the Help panels:
 This example macro implements 4 line commands as shown below. The      
 commands it implements are:                                               
                                                                           
       CE   Center text on a line                                          
       RV   Reverse text on a line                                         
       LEF  Move text all the way left.                                    
       RIT  Move text all the way right.                                   
  ________________________________________________________________________ 
    /* Rexx implement CE, RV, LEF, and RIT line commands                */ 
    Address isredit                              /*  Start of macro     */ 
    "MACRO (PARM) NOPROCESS"                     /*  Get line command   */ 
    Address ispexec "CONTROL ERRORS RETURN"      /*  Return ispf errors */ 
    If wordpos(parm,"CE RV LEF RIT") = 0 Then    /*  If not a command   */ 
        Do                                       /*    we expect        */ 
          zinfo=parm                             /*  Set up for message */ 
          Address ispexec "SETMSG MSG(ISRE041)"  /*    Invalid command  */ 
          Exit  8                /* let ISPF handle the error           */ 
        End                      /*                                     */ 
    "PROCESS RANGE" parm         /* Get range for command               */ 
    If rc>0  Then                /* If something went wrong             */ 
      Do                         /*                                     */ 
        Address ispexec  "SETMSG MSG(ISRZ002)"   /* Set ISPF's message  */ 
        Exit  8                  /* Let ISPF handle the error           */ 
      End                        /*                                     */ 
    "(START) = LINENUM .ZFRANGE" /* Get 1st line number in the range    */ 
    "(STOP)  = LINENUM .ZLRANGE" /* Get last line number in the range   */ 
    "(DW)  = DATA_WIDTH"         /* Get the width of the editable data  */ 
    Do a = start to stop         /* Loop through the range of lines     */ 
      "(LINE) = LINE "a          /* Get old line value                  */ 
      SELECT                     /* process the command for this line   */ 
        When(parm = "CE")  Then line=center(strip(line),dw) /* Center   */ 
        When(parm = "RV")  Then line=reverse(line)          /* Reverse  */ 
        When(parm = "LEF") Then line=strip(line,"L")    /* Left justify */ 
        When(parm = "RIT") Then line=right(strip(line,"T"),dw) /* Right  . 
                                 /*                            Justify  */ 
        Otherwise  Nop           /* Otherwise no op (shouldn't get here)*/ 
      End                        /*                                     */ 
      "LINE "a" = (LINE)"        /* Set new line value                  */ 
    End                          /* End of loop through lines           */ 
    exit 0                       /* Return to ISPF                      */ 
  ________________________________________________________________________ 
 
Prerequisites
LMAC V1.14 requires ISPF for z/OS version 1.8.
 
 
Installation Instructions
LMAC is contained in a self-extracting Zip file. To extract (unzip) the contents of the Zip file, double-click the .exe file and specify a temporary folder on your workstation.

Once you have unzipped the package, follow the installation instructions in the README file to install LMAC and invoke the program.
 
Download package
Download RELEASE DATE LANGUAGE SIZE(Bytes) Download Options
LMAC tool2/12/2008US English52224FTP
README2/12/2008US English2222FTP
 
Technical support
If you have problems with the installation or questions about the program, contact ispf@au1.ibm.com.
 
 

Copyright and trademark information

IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.

Rate this page

Please take a moment to complete this form to help us better serve you.

This material provides me with the information I need.






This material is clear and easy to understand.






Did the information help you to achieve your goal?

What updates, improvements, or related information would you like to see in this document?

Your response will be used to improve our document content. Requests for assistance, if applicable, should be submitted through your normal support channel as we cannot respond from this site.


Input the verification number to submit feedback:



Document information

Product categories:

Software

Software Development

Traditional Progamming Language & Compilers

ISPF for z/OS

ISPF


Operating system(s):

z/OS


Software version:

1.9, 1.10, 1.11


Reference #:

4014047


IBM Group:

Software Group


Modified date:

2008-12-02

Translate my page