The order of EX664 & EX665 should be reatained only the record containing the EX666 should be sorted for 49th pos thru 53rd pos which is for 4 bytes.
records sorting amongs the EX666 without changing the order of EX664 & EX665.
The data will always have 1 record containing EX664,
but there could be multiple records of EX665 and the max is up to 3 records.
The EX666 is also a multiple recrord and there is no max limit for this.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Jun 18, 2009 11:10 pm Post subject:
bsaishankar,
what is the LRECL and recfm of the input file? So You have groups of records which start EX664? and within each group you just need to sort EX666 records? Is that it? what is the position and format of EX664?
Show a sample of output also. _________________ Kolusu
www.linkedin.com/in/kolusu
LRECL-200 BYTES
REC FM- VB
Yes we have group of records that start with EX664 & then EX665 and EX666 for a given customer.
Yes just need to sort EX666 records only.
Position of EX664/EX665/EX666=> starts at 1st postion,5 char length (due to VB file we have to code 5 beg pos,5 char length)
Sequence number is another unique field for the customer and it starts from 7th pos, 2 bytes size char field(due to VB file we have to code 11,2)
sorted field for EX666 is 45th pos(49 due to VB file) and length is 4 bytes and is a char field.
Input sample:
EX664 1---some data continues till the 200th byte
EX665 1---some data continues till the 200th byte
EX665 1---some data continues
EX665 1---same as above
EX666 1---0005=> let say these are 45 thru 49 POSITIONS for EX666
EX666 1---0004=> let say these are 45 thru 49 POSITIONS for EX666
EX664 2------some data continues till the 200th byte
EX665 2 ---some data continues till the 200th byte
EX665 2---some data continues till the 200th byte
EX666 2---0003=> let say these are 45 thru 49 POSITIONS for EX666
EX666 2---0002=> let say these are 45 thru 49 POSITIONS for EX666
and so on..
Expected output sample:
EX664 1---some data continues till the 200th byte
EX665 1---some data continues till the 200th byte
EX665 1---some data continues
EX665 1---same as above
EX666 1---0004=> let say these are 45 thru 49 POSITIONS for EX666
EX666 1---0005=> let say these are 45 thru 49 POSITIONS for EX666
EX664 2---some data continues till the 200th byte
EX665 2 ---some data continues till the 200th byte
EX665 2---some data continues till the 200th byte
EX666 2---0002=> let say these are 45 thru 49 POSITIONS for EX666
EX666 2---0003=> let say these are 45 thru 49 POSITIONS for EX666
and so on..
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum