Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
mksranjani wrote:
It can be 10,00,000+
Nice to know :-)
So, it is a big file. You want to make sure you get it right first time with your test data. What order do you want the output in? Not a big thing, because you could always do it later.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
OK, so give Vasanthz's code a whirl with your test data. Let us know. It would be worth keeping a check on this topic, as there might be other solutions suiting your file size, who know's?
If you're OK with Vasanthz's code, make sure you look up everything and understand what it is doing. Note the comment about FBA for the output.
thanks Vasanthz, I tried the code you provided.
It works fine.
In the output
Code:
ABC001 3
ABC002 2
output data starts at the 2nd position. can you please tell me the reason for why it has not started at the 1st position. Also, about the spacing between the data and the count.
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
Hello,
Quote:
output data starts at the 2nd position. can you please tell me the reason for why it has not started at the 1st position.
The first byte of FBA dataset has ASA print control characters. I am not aware of creating a FB dataset by using OCCUR operator, maybe some of the SORT experts could provide you a better solution.
I tried the USING keyword with OCCUR, but looks like USING is not supported with OCCUR operator. :S
Or if you file is already sorted in Key (257 through 262) then replace SORT FIELDS=(257,6,CH,A),EQUALS with SORT FIELDS=COPY. If you don't want leading zeros suppressed then replace M10 with M11. Here X in the TRAILER3 controls spacing between your key fields and count. If you want 2 spaces use 2X and so on.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
I am not aware of creating a FB dataset by using OCCUR operator, maybe some of the SORT experts could provide you a better solution.
You can use OCCUR's NOCC option to create an FB file (without the carriage control character) instead of an FBA file (with the carriage control character).
You can use OCCUR's BETWEEN(n) option to change the number of spaces between columns.
You can also use various OCCUR formatting options to edit the VALCNT value.
For complete details on the OCCUR operator of DFSORT's ICETOOL, see:
Thanks everyone for giving solutions. There was a mistake from my side. That's y the output was starting at the second position.
Im not sure of the format of the input file. Data ABC001 was at position 257 in the input file. But only when I changed the position of the sort field as 258 : 6 , it worked fine. the output started at the first position
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
ABC001 3
ABC002 2
**************************** Bottom of Data ****************************