Mainframe Utility: SIGN

Return to Mainframe Utilities Page

Module


ISREDIT MACRO (OPT1,OPT2,OPT3,OPT4)
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
/******************************************************************/
/* 'SIGN' EDIT MACRO. CHANGE SIGNED DATA IN A FILE FROM POSITIVE  */
/*  OR NON-SIGNED TO NEGATIVE OR VICE VERSA.  PACKED OR ZONED.    */
/* AUTHOR : DAVID LEIGH    DATE : 10-11-88                        */
/******************************************************************/

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

IF &DATATYPE(&STR(&OPT1)) = NUM THEN +
    DO
        SET COLUMN = &OPT1
        SET SIGN = &STR(+)
        SET CLUDED = NX
        SET TYPE = ZONED
    END
ELSE +
    DO
        SET ZEDLMSG = &STR(*** COLUMN : "&OPT1" IS INVALID *** +
                           MUST BE NUMERIC ***)
        ISPEXEC SETMSG MSG(UTLZ001)
        EXIT
    END

IF &STR(&OPT2) = &STR(+) OR +
   &STR(&OPT3) = &STR(+) OR +
   &STR(&OPT4) = &STR(+) THEN SET SIGN = &STR(+)

IF &STR(&OPT2) = &STR(-) OR +
   &STR(&OPT3) = &STR(-) OR +
   &STR(&OPT4) = &STR(-) THEN SET SIGN = &STR(-)

IF &STR(&OPT2) = X OR +
   &STR(&OPT3) = X OR +
   &STR(&OPT4) = X THEN SET CLUDED = X

IF &STR(&OPT2) = NX OR +
   &STR(&OPT3) = NX OR +
   &STR(&OPT4) = NX THEN SET CLUDED = NX

IF &STR(&OPT2) = PACKED OR +
   &STR(&OPT3) = PACKED OR +
   &STR(&OPT4) = PACKED THEN SET TYPE = PACKED

IF &STR(&OPT2) = ZONED OR +
   &STR(&OPT3) = ZONED OR +
   &STR(&OPT4) = ZONED THEN SET TYPE = ZONED

IF &TYPE = ZONED THEN +
    IF &STR(&SIGN) = &STR(+) THEN +
        DO
            ISREDIT CHANGE X'F0' X'C0' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'F1' X'C1' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'F2' X'C2' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'F3' X'C3' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'F4' X'C4' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'F5' X'C5' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'F6' X'C6' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'F7' X'C7' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'F8' X'C8' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'F9' X'C9' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'D0' X'C0' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'D1' X'C1' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'D2' X'C2' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'D3' X'C3' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'D4' X'C4' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'D5' X'C5' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'D6' X'C6' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'D7' X'C7' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'D8' X'C8' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'D9' X'C9' &COLUMN ALL &CLUDED
        END
    ELSE +
        DO
            ISREDIT CHANGE X'F0' X'D0' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'F1' X'D1' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'F2' X'D2' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'F3' X'D3' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'F4' X'D4' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'F5' X'D5' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'F6' X'D6' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'F7' X'D7' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'F8' X'D8' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'F9' X'D9' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'C0' X'D0' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'C1' X'D1' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'C2' X'D2' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'C3' X'D3' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'C4' X'D4' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'C5' X'D5' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'C6' X'D6' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'C7' X'D7' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'C8' X'D8' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'C9' X'D9' &COLUMN ALL &CLUDED
        END
ELSE +
    IF &STR(&SIGN) = &STR(+) THEN +
        DO
            ISREDIT CHANGE X'0F' X'0C' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'1F' X'1C' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'2F' X'2C' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'3F' X'3C' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'4F' X'4C' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'5F' X'5C' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'6F' X'6C' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'7F' X'7C' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'8F' X'8C' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'9F' X'9C' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'0F' X'0C' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'1D' X'1C' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'2D' X'2C' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'3D' X'3C' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'4D' X'4C' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'5D' X'5C' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'6D' X'6C' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'7D' X'7C' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'8D' X'8C' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'9D' X'9C' &COLUMN ALL &CLUDED
        END
    ELSE +
        DO
            ISREDIT CHANGE X'0F' X'0D' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'1F' X'1D' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'2F' X'2D' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'3F' X'3D' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'4F' X'4D' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'5F' X'5D' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'6F' X'6D' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'7F' X'7D' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'8F' X'8D' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'9F' X'9D' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'0F' X'0D' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'1C' X'1D' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'2C' X'2D' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'3C' X'3D' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'4C' X'4D' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'5C' X'5D' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'6C' X'6D' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'7C' X'7D' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'8C' X'8D' &COLUMN ALL &CLUDED
            ISREDIT CHANGE X'9C' X'9D' &COLUMN ALL &CLUDED
        END

ISREDIT CURSOR = 1 &COLUMN

EXIT

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


Documentation


 This utility allows you to change un-signed or signed data to positive or
 negative signed numbers.  It can handle packed or zoned decimal numbers.  To
 invoke it, type SIGN 999 -/+ packed/zoned on the command line of a file that
 you are editing and press ENTER.  The '999' is the column number that is to be
 changed and must be specified.  "-" or "+" can be specified to denote the sign
 that you want to change to ("+" is the default).  "Packed" or "zoned" can be
 specified to indicate the type of data being changed ("zoned" is the default.)
            


Leave a Reply

Your email address will not be published. Required fields are marked *