View previous topic :: View next topic
|
Author |
Message |
priyasriramulu
New User
Joined: 16 May 2007 Posts: 2 Location: chennai
|
|
|
|
Hi,
I have a Vsam file say FILE1. I open in I/O mode in my program and i do the following:
1. Read FILE1 in sequence.
2. add new records to FILE1 based on some condition.
3. Rewrite the existing records in FILE1
4. Delete some records in FILE1
My requirement is i need to display 2 types of messages in output.
1. the number of records the FILE1 file had initially before processing
2. Number of records in FILE1 after procesing.
please let me know what would be the easiet way to handle this other than reading the FILE1 before processing(So the program will read it twice which is not my intention).
Thanks,
snoopy |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Keep counts of reads, adds, updates, and deletes and produce statistics at the end of the run. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Keep an external log file with the starting record count (which is the ending record count from the prior execution), track the number of records inserted/deleted, and then update the log with the ending record count. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
What kind of VSAM file? KSDS? RRDS? ESDS? |
|
Back to top |
|
|
priyasriramulu
New User
Joined: 16 May 2007 Posts: 2 Location: chennai
|
|
|
|
It is a KSDS type. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
priyasriramulu wrote: |
1. Read FILE1 in sequence.
2. add new records to FILE1 based on some condition.
3. Rewrite the existing records in FILE1
4. Delete some records in FILE1 |
Can we assume that 3 & 4 are also 'based on some condition'?
Is the condition based upon something in the record read from FILE1?
Or is the condition based upon some other file input? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
It should be rather straight forward. . .
To repeat:
Quote: |
Keep counts of reads, adds, updates, and deletes and produce statistics at the end of the run. |
Reads and adds would be a +1, updates not change the total (you might still count them), and deletes would be a -1.
As Kevin mentioned, you might also maintain an external log of the count(s) after each run. |
|
Back to top |
|
|
|