Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
VSAM File not opening in I-O Mode
Goto page Previous  1, 2
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Robert Sample

Global Moderator


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

PostPosted: Mon Sep 29, 2008 5:08 pm    Post subject:
Reply with quote

Quote:
OPEN I-O I-O-FILE.
DISPLAY 'OPENING I-O-FILE'.
READ I-O-FILE.
DISPLAY 'READING I-O-FILE'.
Uh, this code is not right. You need to establish a starting point for the read by moving LOW-VALUES or whatever you want to read to ABCD (your record key) before doing the read. From the manual on the READ statement:
Quote:
6.2.28.7.1 Indexed files


Execution of a format 2 READ statement causes the value of the key of reference to be compared with the value of the corresponding key data item in the file records, until the first record having an equal value is found. The file position indicator is positioned to this record, which is then made available. If no record can be so identified, an INVALID KEY condition exists, and READ statement execution is unsuccessful. (See "Invalid key condition" under "Common processing facilities" in topic 6.1.8.9.)


If you want to read the first record in the file you must use READ I-O-FILE NEXT and I still recommend setting ABCD to LOW-VALUES before doing the read.
Back to top
View user's profile Send private message

swathiravichandran

New User


Joined: 21 Jul 2008
Posts: 19
Location: Mumbai

PostPosted: Mon Sep 29, 2008 5:43 pm    Post subject: Reply to: VSAM File not opening in I-O Mode
Reply with quote

Volume serial: ,P2PE14
File Type: , KSDS
Device type: , 3390
CI Size: , 32768
Key length: , 40
Key location: , 0
Record format: , V
Average record length: , 375
Maximum record length: , 32700
Physical block size: , 32760
Primary cylinders: , 4
Secondary cylinders: , 50

This is my VSAM layout.How will be my DCB parameter then??
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Mon Sep 29, 2008 5:46 pm    Post subject:
Reply with quote

VSAM files do not have DCB; they have ACB.

And you still need to change your code before it will work, no matter what the VSAM file looks like.
Back to top
View user's profile Send private message
swathiravichandran

New User


Joined: 21 Jul 2008
Posts: 19
Location: Mumbai

PostPosted: Mon Sep 29, 2008 5:50 pm    Post subject: Reply to: VSAM File not opening in I-O Mode
Reply with quote

Hi Robert,
In the JCL we have to specify DCB parameters.That one I m asking about.
Back to top
View user's profile Send private message
hchinnam

New User


Joined: 18 Oct 2006
Posts: 73

PostPosted: Mon Sep 29, 2008 5:58 pm    Post subject:
Reply with quote

Quote:


In the JCL we have to specify DCB parameters.That one I m asking about.



For old VSAM DS you will not specify DCB.

For you new DS, you will use IDCAMS or any other utility to define them.

In either case you don't need a DCB for VSAM.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Mon Sep 29, 2008 6:14 pm    Post subject:
Reply with quote

Putting DCB parameters on a VSAM file will cause problems. You do not use DCB parameters with VSAM files. You can specify in JCL AMP=AMORG to indicate a VSAM file, or if you want to specify some buffers you can specify AMP=('BUFND=30,BUFNI=5') or whatever makes sense in your case. But in no case will you specify DCB in the JCL for a VSAM file.
Back to top
View user's profile Send private message
swathiravichandran

New User


Joined: 21 Jul 2008
Posts: 19
Location: Mumbai

PostPosted: Mon Sep 29, 2008 8:20 pm    Post subject: Reply to: VSAM File not opening in I-O Mode
Reply with quote

what can I do if I get a file status code of 23??
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Mon Sep 29, 2008 8:34 pm    Post subject:
Reply with quote

A file status 23 is normal and expected when you do a random READ (or START) and the record key you specified does not exist. What can you do? Read a different record, write the new record into the file, or skip the record and proceed -- what you do depends on the application requirements and you're certainly not going to find that out on a forum.
Back to top
View user's profile Send private message
ridgewalker58

New User


Joined: 26 Sep 2008
Posts: 51
Location: New York

PostPosted: Mon Sep 29, 2008 9:55 pm    Post subject:
Reply with quote

And what was the value that was in the WS-VSAM-STATUS field when your program displayed VSAM UN-SUCCESSFUL'. The VSAM UN-SUCCESFUL message seems to say that the OPEN was UNSUCCESSFUL.

Does your VSAM file have any records in it,
Does your VSAM file have records that are within the sizes in your
01 level record descriptions in the FD clause
OR
If your VSAM file has only one sized record, does your 01 level match that record size
OR
Does your RECORD KEY field in your FD clause match the KEY field that you used in your Define Cluster cards for the VSAM file
Back to top
View user's profile Send private message
swathiravichandran

New User


Joined: 21 Jul 2008
Posts: 19
Location: Mumbai

PostPosted: Tue Sep 30, 2008 9:59 am    Post subject:
Reply with quote

Thank you Robert my problem has solved..since my vsam file contain single record...it is unable to access in randome mode..now the problem is solved icon_smile.gif
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
Goto page Previous  1, 2
Page 2 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Rexx to create VSAM define statements Dinesh Mani CLIST & REXX 9 Fri Nov 29, 2019 9:26 pm
No new posts File transfer issue with end of line ... VINAY PALLELA TSO/ISPF 4 Thu Nov 14, 2019 12:01 am
No new posts File compare, where file has header a... VINAY PALLELA SYNCSORT 8 Thu Nov 07, 2019 5:05 pm
No new posts OMIT first and last column of a pipe-... karthikb_itpro DFSORT/ICETOOL 1 Fri Nov 01, 2019 8:24 pm
No new posts How to place name of the file where t... danielgp89 SYNCSORT 18 Thu Oct 17, 2019 12:55 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us