Mainframe Utility: SETMASK

Return to Mainframe Utilities Page

Module


ISREDIT MACRO NOPROCESS (PARM)
ISPEXEC CONTROL ERRORS RETURN
/**** SET MESSAGE DISPLAY ON/OFF BASED ON THE DEBUG SWITCH ***/
ISPEXEC VGET (DBGSWTCH) PROFILE
IF &DBGSWTCH = &STR(ON) THEN CONTROL MSG LIST CONLIST SYMLIST NOFLUSH
ELSE CONTROL NOMSG NOLIST NOFLUSH NOPROMPT
/**********************************************************************/
/* UTILITY NAME : MASK                                                */
/* DATE WRITTEN : 10-12-90                                            */
/* AUTHOR       : DAVE LEIGH                                          */
/* DESCRIPTION  : SET THE MASK LINE TO A GIVEN DATA LINE IN THE FILE. */
/*                (THIS CAN BE HELPFUL FOR DEFINING MASK LINES WITH   */
/*                 HEX CHARACTERS.)                                   */
/*========================== MODIFICATIONS ===========================*/
/* WHO         ¦WHEN     ¦WHY                                         */
/* ---         ¦----     ¦---                                         */
/**********************************************************************/

IF &STR(&PARM) = HELP THEN GOTO HELPSEC

ISREDIT PROCESS RANGE M
IF &LASTCC ¬= 0 THEN +
    DO
        SET ZEDLMSG = &STR(*** NO LINE MARKED "M" TO USE AS THE +
                           MASK LINE ***)
        ISPEXEC SETMSG MSG(UTLZ001)
        EXIT
    END
ELSE +
    ISREDIT (MLINE) = LINE .ZFRANGE

ISREDIT MASKLINE = (MLINE)
ISREDIT DELETE .ZFRANGE

SET MCC = &LASTCC

IF &MCC = 0 THEN +
    DO
        SET ZEDLMSG = &STR(*** THE "M" LINE IS NOW THE "MASK" LINE +
                           ***)
        ISPEXEC SETMSG MSG(UTLZ000)
    END
ELSE +
    DO
        SET ZEDLMSG = &STR(*** SETTING THE MASK LINE FAILED WITH A +
                           RETURN CODE OF "&MCC" ***)
        ISPEXEC SETMSG MSG(UTLZ001)
    END

EXIT

HELPSEC: +                                                              02480000
ISPEXEC SELECT PGM(ISPTUTOR) PARM(HELPSHEL)                             02490000
SET ZEDLMSG = &STR(*** HELP DISPLAYED FOR "SETMASK" EDIT MACRO +        02490000
                   *** NO PROCESSING PERFORMED ***)                     02490000
ISPEXEC SETMSG MSG(UTLZ000)                                             02490000
EXIT
            


Documentation


 This utility takes a little backround to explain.  The ISPF editor has a
 concept called "MASK" lines.  MASK lines can be thought of as templates for new
 lines in a file.  When you use the "I" line command in edit, a new blank line
 is used by default for each insert.  The lines inserted do not have to be blank
 however.  If a MASK line is set up, it will be inserted instead of a blank
 line.

 If you type MASK as a line command, ISPF allows you to define the mask
 interactively.  For the rest of that edit session (or until you change it), the
 MASK line will be inserted.  This is all well an good, but what if you want to
 create a MASK line with special HEX characters that cannot be
 typed....well....you're sunk.

 Why, you ask, would you want to do such a thing?

 Certain special HEX characters cause your cursor to skip over them in an edit
 session....like a TAB sort of.  By inserting these characters in certain
 columns on each line, you can greatly facilitate entering data which must be in
 specific columns.  Those special characters will prevent you from typing in the
 wrong columns.

 The SETMASK utility allows you to specify a line of text in your file as the
 MASK line.

 Because you can use a line of text in the file, you can turn HEX ON and place
 those special characters such as X'00' wherever you wish, mark the line with an
 "M" in the line number, type SETMASK on the command line and press .
 Now that line is the MASK line.
            


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.