Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with VSAM ESDS file

Status
Not open for further replies.

dosscics

Programmer
Jan 7, 2004
6
US
I am trying to rewrite records in a ESDS online VSAM file ..
1) I close the file to run a batch COBOL program
2) If I open it I-O, the read of the ESDS VSAM doesn't appear to be valid .. i.e. The 'display' of the record read is spaces?
3) I am using the following COBOL statements:
SELECT ESDSVSAM ASSIGN TO SEQUENTIAL-AS-FILE1
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS A-FILE-STAT
VSAM-CODE.
PROCEDURE DIVISION.
OPEN I-O ESDSVSAM.
READ ESDSVSAM INTO WS-FILE-LAYOUT
AT END PERFORM CLOSE.

It's reading past the last record -- I have to do a STOP RUN to end the program?

Note: The ESDS VSAM is defined as NONINDEXED
 
Hi,

Since you coded a file-status field you might as well test it. It will tell you if the i-o stmt you just executed was successful or not. If Ok you'll most likely get a zero RC, if not, the code returned will tell you what went wrong.

P.S. why don't you show us the REAL code, i.e. cut and paste it into your post. Also click the "Preview Post" button and scroll down to "EDITING TIPS". The note will tell you how to get your code formatted correctly for your post.

Regards, Jack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top