Hi,
i'm working on migration project, i need to insert, change and delete a SAME LINES OF CODE for many applications. To do efficiently and effectively can we use REXX/MACRO. Iam new to REXX and coded few programs with the help of this forum, iam very much thankful. Below is a sample code:
INPUT: test.startus.app1 (ps file)
IDENTIFICATION DIVISION.
PROGRAM-ID.SANSOFT.
*
ENVIRONMENT DIVISION.
SOURCE-COMPUTER. STRATUS/32
OBJECT-COMPUTER. STRATUS/32
*
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-STUDENT-NAME PIC X(6) VALUE SPACES.
01 JUL-DATE PIC 9(7) VALUE ZEROS. //YYYY-MM-DD
01 GREG-DATE PIC 9(8) VALUE ZEROS. //YYYYDDD
PROCEDURE DIVISION.
DECLARATIVES.
FIRST DECLARATION
SECOND DECLARATION
THIRD DECLARATION
END-DECLARATIVES.
CALL S$DATE_TIME USING JUL-DATE, //FUNCTION TO CONVERT JULIAN DATE TO GREGOIAN DATE
GREG-DATE.
DISPLAY 'GREGORIAN DATE:' GREG-DATE.
IF !UPPER-CASE(WS-STUDENT-NAME) = 'ABCDEF'
DISPLAY 'STUDENT NAME :' WS-STUDENT-NAME
END-IF.
CALL S$STOP_PROGRAM. //FUNCTION TO STOP PROGRAM
DESIRED OUPUT: test.mf.app1 (ps file)
IDENTIFICATION DIVISION.
PROGRAM-ID.SANSOFT.
*
ENVIRONMENT DIVISION.
SOURCE-COMPUTER. IBM-371
OBJECT-COMPUTER. IBM-371
*
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-STUDENT-NAME PIC X(6) VALUE SPACES.
01 GREG-DATE PIC 9(8) VALUE ZEROS.
*****YYYY-MM-DD
01 JUL-DATE PIC 9(7) VALUE ZEROS.
******YYYYDDD
PROCEDURE DIVISION.
ACCEPT JUL-DATE.
COMPUTE DD = FUNCTION INTEGER-OF-DAY (JULIAN-DT).
COMPUTE GREG-DATE = FUNCTION DATE-OF-INTEGER (DD).
*****FUNCTION TO CONVERT JULIAN DATE TO GREGOIAN DATE
DISPLAY 'GREGORIAN DATE:' GREG-DATE.
IF FUNCTION UPPER-CASE(WS-STUDENT-NAME) = 'ABCDEF'
DISPLAY 'STUDENT NAME :' WS-STUDENT-NAME
END-IF.
STOP RUN.
CHANGE: wherever the code contains
'!upper-case" ---> "function upper-case
SOURCE-COMPUTER. STRATUS/32 ----> SOURCE-COMPUTER. IBM-371
DELETE: after procedure divison if DECLARATIVES are there i want to delete those lines.
INSERT: i want to replace a piece of code like date logic
CALL S$DATE_TIME USING JUL-DATE,
GREG-DATE.
COMPUTE DD = FUNCTION INTEGER-OF-DAY (JULIAN-DT).
COMPUTE GREG-DATE = FUNCTION DATE-OF-INTEGER (DD)
can any body suggest me how can i do this using REXX/MACRO. It will be more helpful for me....
Thanks in advance.....