Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
Posted: Thu Jul 17, 2003 5:18 am Post subject:
Deepesh,
The overlapping is obvious here. In CTL2CNTL, you are asking for, 10 binary zeroes at first, then first 10 columns from the input file. The number of bytes used are 20. Then, you are asking for sequence numbers from the 20th column itself.
So, modify your CTL1 and CTL2 so that, Sequence numbers start at 21st column. From the first file, there will be 10 bytes of data, 10 binary zeroes and 8 PD sequence numbers. (Total 28 and not 27). From the second file, there will be 10 binary zeroes, 10 bytes of data and 8 PD sequence numbers. (Total 28 and not 27).
You still have not answered my query in my first post. _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Thu Jul 17, 2003 5:38 am Post subject:
deepeshk79,
There are a couple of errors in your job.let me clarify as to how you can merge two files together
we copy the first file to a temp file with follwing layout
1 to 10 bytes - we have contents from IN1 as is
10 to 20 bytes - we need to pad with binary zeroes for the second file contents
21 - you can have a seqnum
for the second file you need to copy to temp file with the following layout
1 to 10 bytes - we need to pad with binary zeroes
10 to 20 bytes - we copy contents of IN2 as is
21 - you can have a seqnum
now you concatenate these files together and sort on the seqnum while summing the bytes 11 thru 20
so change your ctl1cntl to the following
Code:
OUTREC FIELDS=(1,10, $ FROM INPUT AS IS
10Z, $ 10 BINARY ZEROES
SEQNUM,8,PD) $ 8 BYTES SEQNUM
change your ctl2cntl to the following
Code:
OUTREC FIELDS=(10Z $ 10 BINARY ZEROES
1,10, $ FROM INPUT AS IS
SEQNUM,8,PD) $ 8 BYTES SEQNUM
Change your Ctl3cntl to the following. For the binary you can only sum on 2,4,8 bytes only. you coded as 10 bytes.
Code:
OPTION EQUALS
SORT FIELDS=(21,8,PD,A) $ SORT ON SEQNUM
SUM FIELDS=(11,8,19,2),FORMAT=BI $ SUM ON THE BYTES 11 - 20
OUTREC FIELDS=(1,20) $ STRIP THE SEQNUM
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