Hi,
I have one sequential file (LRECL=80) with the below record structure:
HH -------> Header Record
AS,Empid1,H,N,current date,22:00,06:00-----> Detail record
JR,W,22:00,05:00,D008,S9518 ------> All JR records are part of the AS record.
JR,L1,05:00,05:30,D008,S9518
JR,W,05:30,06:00,D008,S9518
AS,Empid2,H,N,Previous date,22:00,06:00-----> Detail record
JR,W,22:00,05:00,D008,S9518 ------> All JR records are part of the AS record.
JR,L1,05:00,05:30,D008,S9518
JR,W,05:30,06:00,D008,S9518
TT ----------> Trailer record
The requirement is to sort the only AS records in detail record in ascending order by Empid & current date.
The file is currently having records in random order.
Emp id position is position is AS record is 5, length 7
Date filed position 13, length 8.
The output file should have the header & trailer as it is. And the format should be like the existing file but only in ascending order of AS record.
Appreciate your help!
Thanks,
Purva