JCL Sort for VB file

978 views Asked by At

I Have 50 bytes of VB file

EMP Name    Pic X(5)
EMP ID      S9(9) comp
EMP Address Pic X(3)

we need to sort the file based on EMP address by ascending order so where the record position will start?

SORT FIELDS=(20,3,CH,A)

Is this correct ?

1

There are 1 answers

1
phunsoft On

No, not corrcect.

The "PIC X(5)" is 5 bytes in length, the "PIC S9(9) COMP is 4 bytes, so the "EMP Address" starts at byte 10 of the data. Since the record format is VB, the first data byte comes after the RDW (4 bytes). Therefore:

SORT FIELDS=(14,3,CH,A)