IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Compare the file record count percentagefrom yesterday's run


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gangwsus

New User


Joined: 02 Jun 2009
Posts: 2
Location: Mumbai

PostPosted: Tue Jan 26, 2021 4:11 am
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Jan 26, 2021 4:59 am
Reply with quote

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
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 967
Location: Maryland

PostPosted: Tue Jan 26, 2021 5:04 am
Reply with quote

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
View user's profile Send private message
gangwsus

New User


Joined: 02 Jun 2009
Posts: 2
Location: Mumbai

PostPosted: Tue Jan 26, 2021 1:27 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2591
Location: NYC,USA

PostPosted: Tue Jan 26, 2021 5:47 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts exclude the 5 first lines for compare... TSO/ISPF 2
This topic is locked: you cannot edit posts or make replies. how to extract a portion (e.g. fields... SYNCSORT 8
This topic is locked: you cannot edit posts or make replies. Writng matched records into output fi... DFSORT/ICETOOL 11
No new posts compare two file to find position/dat... SYNCSORT 2
No new posts Converting a file from PD to display ... SYNCSORT 4
Search our Forums:

Back to Top