Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
techslam,
Assuming that the data is already sorted on admin and date field , the following DFSORT JCL will give you the desired results. If the data is not sorted change SORT FIELDS=COPY to SORT FIELDS=(1,12,CH,A)
I can see, you have moved the required fields to a different file and then sorted it from there and performed the count from there. What will be my code, if I want to view that sorted file with required fields?
I have used the latest sort control statements given here by Skolusu.
It works fine for a small test file will less number of records,
But when I gave the original input file which has 1250000 records in it, there is issue in the out put file generated :
Code:
123456789 ON 20100701 = 2
123456789 ON 20100707 = 2006
123456789 ON 20100702 = 14
123456789 ON 20100706 = 2
123456789 ON 20100701 = 4
here for the date 20100701 there are two counts, 2 and 4, it should have been
Code:
123456789 ON 20100701 = 6
What is causing this issue to occur ?
It happens with many admin id's in the file.
Please advice....
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
techslam wrote:
Hi
I have used the latest sort control statements given here by Skolusu.
It works fine for a small test file will less number of records,
But when I gave the original input file which has 1250000 records in it, there is issue in the out put file generated :
NO. You did not use the same control cards as I have shown as you added 2 more fields from pos 4414 for 1 byte and from position 4443 for 1 byte. These 2 bytes are also used in the control break processing and hence the wrong results. I used 17 bytes for key break where as you used 19 bytes for the key break. Please don't attribute your mistakes as mine.
techslam wrote:
I can see, you have moved the required fields to a different file and then sorted it from there and performed the count from there. What will be my code, if I want to view that sorted file with required fields?
I can't keep working on the same requirement over and over whenever you change the requirements. You need to do a better job of explaining the complete requirement in one go rather than in bits and pieces.
I appreciate you helping me out in this requirement and I apologise for making changes in my requirements. I have worked on your code and now I am getting the desired output the way I wanted . It is given below
Code:
123456789 XP 20100701 2
123456789 XP 20100707 2006
123456789 XP 20100702 14
123456789 XP 20100706 2
123456789 YP 20100701 4
Everything looks fine here, I just need one final thing, I have made the counter of length 9 bytes and I want the counter output appended with zeros rather than spaces.
that is :
Code:
123456789 XP 20100701 000000002
123456789 XP 20100707 000002006
123456789 XP 20100702 000000014
123456789 XP 20100706 000000002
123456789 YP 20100701 000000004
Kindly advice. I really appreciate this help through this forums.
I got my desired output.
Iam a newbie to DFSORT, so I really appreciate all the help provided here.
Getting Started DFSORT and DFSORT Application programming guide are awesome documents and I am reading them to get good knowledge.