I have this requirement to create a tool using REXX wherein user will provide Header Variables and then REXX will calculate its length and provide to output.
Input:
Name
Contact
AddressLine1
AddressLine2
Contact
AddressLine1
AddressLine2
Output should be
01 WS-HEADER.
05 WS-HDR1 PIC X(04) VALUE 'Name'.
05 WS-HDR2 PIC X(07) VALUE 'Contact'.
05 WS-HDR3 PIC X(12) VALUE 'AddressLine1'.
05 WS-HDR4 PIC X(12) VALUE 'AddressLine2'.
05 WS-HDR1 PIC X(04) VALUE 'Name'.
05 WS-HDR2 PIC X(07) VALUE 'Contact'.
05 WS-HDR3 PIC X(12) VALUE 'AddressLine1'.
05 WS-HDR4 PIC X(12) VALUE 'AddressLine2'.
where, WS-HEADER AND WS-HDR* variables will be constant.
I am new to REXX. Kindly assist.
Thank you in advance!
Code'd