Joined: 21 Nov 2006 Posts: 6 Topics: 1 Location: Central Illinois
Posted: Wed Jun 04, 2008 1:20 pm Post subject: create dfsort report of changes and a file of new adds
I am comparing todays file to yesterdays file and I need to create a simple report of any record that changes and file of any new records. In the file of new records I need to change the value of positions 41 and 39 from a 0 to 1. Can this be done utilizing DFSORT ??In one step??? In my COBOL mind this is short program but I am still learning the newer features of DFSORT. My file has a length of 41 and is keyed on position 3 for length of 9.
In this example I would expect records 1,3 and 5 to be on the report and records 6,7 and 8 to be in the new file with postion 39 and 41 now a 1 instead of 0. Nothing would happen to records 2 and 4 as they stayed the same.
The change,if any, will be indicated by postion 13 for length of 5. On the simple report of changed records I need postion 3 for length of 9 and postion 13 for length of 5 from both files.
Joined: 21 Nov 2006 Posts: 6 Topics: 1 Location: Central Illinois
Posted: Thu Jun 05, 2008 9:56 am Post subject:
Thanks Kolusu I will be implementing this in the next few days. I see in your example that it only creates a file to be used in creating a report. Can this same step create the the report or do I take from your example and make a second step to utilize ICETOOL to make the report. I know I can do this with a second step utilizing the RPT file but I am curious if it could be done in one step. Thank you for your assistance.
Joined: 21 Nov 2006 Posts: 6 Topics: 1 Location: Central Illinois
Posted: Thu Jun 05, 2008 11:51 am Post subject:
header one is postion 3 for length of 9 and header 2 is from new (todays)file postion 13 for length of 5 and header three is from old (yesterdays) file postion 13 for length of 5
Your first example was successful, however the second one when changing the CTL1CNTL to your code gave me a S0C7 saying "UNSUCCESSFUL SORT" in the JESYSMSG
Thanks so much for this!!! It works beautifully ... the one thing that kind of stood out though was the second record Agent_ID = 3456. The data is in reverse, it should be "Y O" for this month and "Y I" for last month, shouldn't it???
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Jun 18, 2008 1:29 pm Post subject:
DeaconEx wrote:
Kolusu
Thanks so much for this!!! It works beautifully ... the one thing that kind of stood out though was the second record Agent_ID = 3456. The data is in reverse, it should be "Y O" for this month and "Y I" for last month, shouldn't it???
Thanks,
DeX
Well we are sorting on the Entire length of the record(14 bytes) in the first pass and eliminating dups. So a "Y I" record would be sorted before "Y O" record . And the last 3 characters dictate if the record is a duplicate or not. If you really want to distinguish then we need to process each file separately adding an indicator to them and then get the results. If that is what you need then let me know I will show a way to get the results
Joined: 21 Nov 2006 Posts: 6 Topics: 1 Location: Central Illinois
Posted: Thu Jun 26, 2008 2:28 pm Post subject:
Kolusu
Is there a way to insert the actual date in the report heading instead of "Today" and Yesterday"? I have tried utilizing a few examples but get a syntax error. The examples I found all have "on (position number, length, format) and I am not sure I can use this with this example you provided. Can you assist?
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