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

COBOL VSAM file handling


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
priyasriramulu

New User


Joined: 16 May 2007
Posts: 2
Location: chennai

PostPosted: Tue Apr 08, 2008 2:09 am
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Apr 08, 2008 2:27 am
Reply with quote

Hello,

Keep counts of reads, adds, updates, and deletes and produce statistics at the end of the run.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Apr 08, 2008 2:29 am
Reply with quote

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

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Apr 08, 2008 2:30 am
Reply with quote

What kind of VSAM file? KSDS? RRDS? ESDS?
Back to top
View user's profile Send private message
priyasriramulu

New User


Joined: 16 May 2007
Posts: 2
Location: chennai

PostPosted: Tue Apr 08, 2008 3:02 am
Reply with quote

It is a KSDS type.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Apr 08, 2008 3:10 am
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Apr 08, 2008 3:19 am
Reply with quote

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
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top