Tags

, , , , , , , ,

Sometimes there is a scenario where you have a Packed Decimal (COMP 3) PD field with definition of S9(8)V99 COMP-3 which needs to be reformatted as S9(10)V99 COMP-3.

In COBOL, this is direct MOVE statement between two fields defined as you need above.
If you need to do it using SORT, use the below SORT CARD for the file layout

SORT FIELDS=COPY,EQUALS
OUTREC FIELDS=(1,10,11,6,PD,PD,LENGTH=7,17,10)

Input file format
01 WS-ACCOUNT-FROM.
05 WS-ACT-NO PIC 9(10).
05 WS-AMT PIC S9(8)v99 COMP-3
05 WS-OTHER PIC X(10)

Output File Format
01 WS-ACCOUNT-TO.
05 WS-ACT-NO PIC 9(10).
05 WS-AMT PIC S9(10)v99 COMP-3
05 WS-OTHER PIC X(10)

Advertisements