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

VSAM file Handling


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

New User


Joined: 04 Aug 2008
Posts: 26
Location: Hyderabad

PostPosted: Tue May 12, 2009 11:27 pm
Reply with quote

Hi,

I have converted a cobol -1 code to cobol-390 . In this program a KSDS file is getting opened in I-O mode. The file is getting delete defined in the 1st step and in the 2nd step my program is using this file. In cobol-1 it is displaying file-status for this file as '00' where as cobol 390 it is giving file status as '35'. In order to resolve this issue I have moved low-values into this VSAM file once it got created(defined). But is will add up one extra record into the file anyways I did used SORT to skip this first rec but it increased some more steps to my JCL.Which is not recommended. So,please let me know is there any better solution for to handle this issue.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Tue May 12, 2009 11:34 pm
Reply with quote

In your COBOL program, open the VSAM file for OUTPUT. Write a record to it. Close it. Open the VSAM file for I-O. Delete the record. Proceed with your normal logic.

A VSAM file that has never had any data written to it will get a file status 35 on OPEN; there was a thread in the last couple of weeks where I wrote the code to verify that.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed May 13, 2009 1:53 am
Reply with quote

If you add a REPRO after the DEFINE, I believe you will be able to open the file as I-O.
For input to the REPRO, use a dummy file.

Try it, then tell us if it works!

By the way, did you search the forum ?
This question have been asked many times:
Initialize VSAM file
How can VSAM file be opened in I-O mode?
Will JOB Abend if Use empty VSAM file
Opening an Empty VSAM in I-O mode.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top