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.
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.