View previous topic :: View next topic
|
Author |
Message |
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
swathiravichandran
New User
Joined: 21 Jul 2008 Posts: 19 Location: Mumbai
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
swathiravichandran
New User
Joined: 21 Jul 2008 Posts: 19 Location: Mumbai
|
|
|
|
Hi Robert,
In the JCL we have to specify DCB parameters.That one I m asking about. |
|
Back to top |
|
|
hchinnam
New User
Joined: 18 Oct 2006 Posts: 73
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
swathiravichandran
New User
Joined: 21 Jul 2008 Posts: 19 Location: Mumbai
|
|
|
|
what can I do if I get a file status code of 23?? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
ridgewalker58
New User
Joined: 26 Sep 2008 Posts: 51 Location: New York
|
|
|
|
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 |
|
|
swathiravichandran
New User
Joined: 21 Jul 2008 Posts: 19 Location: Mumbai
|
|
|
|
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 |
|
Back to top |
|
|
|