Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

COBOL VSAM file handling

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: COBOL VSAM file handling
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

Site Director


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

PostPosted: Tue Apr 08, 2008 2:27 am    Post subject:
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

Moderator Team Head


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

PostPosted: Tue Apr 08, 2008 2:29 am    Post subject: Reply to: COBOL VSAM file handling
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: 2150
Location: At my coffee table

PostPosted: Tue Apr 08, 2008 2:30 am    Post subject:
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    Post subject: Reply to: COBOL VSAM file handling
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: 2150
Location: At my coffee table

PostPosted: Tue Apr 08, 2008 3:10 am    Post subject: Re: COBOL VSAM file handling
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

Site Director


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

PostPosted: Tue Apr 08, 2008 3:19 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 1 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us