View previous topic :: View next topic
|
Author |
Message |
gangwsus
New User
Joined: 02 Jun 2009 Posts: 2 Location: Mumbai
|
|
|
|
Hi, I have a flat file e.g. INPUT. I want to count the number of records and want to write it to another flat file e.g. COUNTFILE. In the next run of the Job, i want to compare the record count with old run. The variation should not be 5%. Than i want to write new count to the file COUNTFILE. Can anyone help me with Sort cards please. Regards, Sushil |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
What have you tried? And what was the result?
Day 1 you sort/copy the dataset (not a file) writing the DFSORT SYSOUT to a dataset - probably a GDG,
Day 2 you repeat with the dataset. You then run another step to compare the counts. If they are not within range then delete the day 2 SYSOUT.
But what happens next? Day 3 do you compare to day 1? Or what? Yo must have walked this through with pencil and paper so what were your conclusions? |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2019 Location: USA
|
|
|
|
Quote: |
I have a number, e.g. 2. I need to add another number, e.g. 3. Next time I need to add two other numbers, and compare to previous amount, but the difference should not be 5% - only 4.5%, or 5.7%, and nothing else.
Can you please help me do this, using a super-duper computer? |
RTFM |
|
Back to top |
|
|
gangwsus
New User
Joined: 02 Jun 2009 Posts: 2 Location: Mumbai
|
|
|
|
Thanks Nic for you suggestion. Let me rephrase the requirement - There will be a daily file from an external system. We need to compare the count of the file from previous run and need to insert the records in a DB2 table. There are other validations as well which i am able to achieve through SORT only. For this record count logic, i have tried to store the count in a file.
Using ICETOOL to store the count in a flat file
Code: |
//TOOLIN DD *
COUNT FROM(INPUT) WRITE(COUNT01)
/* |
Now this step is writing a new row every time and i didn't find in manual that how i should alter the count in COUNT01 i.e. to subtract 5% of the count.
Also How to read the count from file COUNT01 and compare it with record count in file.
Use Code tags |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Take sometime to understand this solution and then try .. it should work for you with little change in % value. Btw you must know what should happen when counts don’t match or go beyond 5%, think thru it . In this example RCs are set which is what you will also need to do to control the processing. Good Luck!
ibmmainframes.com/about54804.html |
|
Back to top |
|
|
|