Mainframe Utility: SPLITTO

Return to Mainframe Utilities Page

Module


ISREDIT MACRO (HELP)
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
IF &HELP = HELP THEN GOTO HELPSEC
/**********************************************************************
/* EDIT MACRO : SPLITTO                                               *
/* AUTHOR     : DAVE LEIGH                                            *
/* DATE       : 6-4-90                                                *
/* FUNCTION   : SPLIT A LINE AFTER A " TO " IN A COBOL PROGRAM AND    *
/*              INSERT A MESSAGE LINE INDICATING THE ACTION TAKEN.    *
/*              ONLY DO THIS ON ERROR LINES.                          *
/**********************************************************************
ISREDIT (USERSTAT) = USER_STATE
ISREDIT UNNUM
ISREDIT BOUNDS 1 80
ISREDIT (SLN,SCL) = CURSOR
SET COUNT = 0
ISREDIT LOCATE FIRST ERROR

DO WHILE &LASTCC = 0
    ISREDIT (LINE1,NULL) = DISPLAY_LINES
    ISREDIT CURSOR = &LINE1 1
    ISREDIT FIND FIRST ' TO ' .ZCSR .ZCSR
    IF &LASTCC = 0 THEN +
        DO
            SET COUNT = &COUNT + 1
            ISREDIT (LN,CL) = CURSOR
            SET CL = &CL + 3
            SET SLEN = 72 - &CL
            ISREDIT TSPLIT .ZCSR &CL
            ISREDIT FIND FIRST P'¬' 12 80 .ZCSR .ZCSR
            ISREDIT FIND NEXT ' ' 12 80 .ZCSR .ZCSR
            ISREDIT FIND NEXT P'¬' 12 80 .ZCSR .ZCSR
            ISREDIT (NULL,X) = CURSOR
            ISREDIT LINE_BEFORE .ZCSR = MSGLINE '*** SPLIT HERE ***'
            ISREDIT CURSOR = &LN &CL
            ISREDIT FIND NEXT P'=' 1
            ISREDIT FIND NEXT P'¬' .ZCSR .ZCSR
            ISREDIT (LN,CL) = CURSOR
            SET Y = &CL + &SLEN
            ISREDIT CHANGE P'=' ' ' &Y 80 .ZCSR .ZCSR ALL
            SET X = &X - &CL
            ISREDIT SHIFT > .ZCSR &X
        END
    ISREDIT LOCATE ERROR
END

SET ZEDLMSG = &STR(*** SPLIT &COUNT LINES *** "L SPECIAL" TO +
                   LOCATE THEM ***)
ISPEXEC SETMSG MSG(UTLZ000)
ISREDIT CURSOR = &SLN &SCL
ISREDIT RESET ERROR
ISREDIT USER_STATE = (USERSTAT)
ISREDIT RIGHT DATA
ISREDIT LEFT  DATA
EXIT

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


Documentation


 This utility is used in conjuction with the LINEUPTO utility (and, in fact, may
 be executed conditionally WITH LINEUPTO by specifying "lineupto split") when
 invoking LINEUPTO.  It will find the lines marked "==ERR>" by LINEUPTO and
 split them just after the " TO ", place the receiving field under the sending
 field and mark the line as "split" with a message line.

 EXAMPLE                                                           | After the
 ==ERR>            MOVE AAAAAAAAAAAAAAAAAAA TO BBBBBBBBBBBBBBBBBB. | split,
 BECOMES                                       +-------------------+ you must
 000001            MOVE AAAAAAAAAAAAAAAAAAA TO | run LINEUPTO again to line up
 000002                 BBBBBBBBBBBBBBBBBBB.   | previous error lines.
            


Leave a Reply

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