View previous topic :: View next topic
|
Author |
Message |
knd_r Currently Banned New User
Joined: 18 Mar 2005 Posts: 48
|
|
|
|
hi,
what will happen if empty vsam file is opened for input?
bye,
ks reddy. |
|
Back to top |
|
|
kanak
Moderator
Joined: 12 Mar 2005 Posts: 252 Location: India
|
|
|
|
nothing, when u will try to read on the first read only it will give eof reached. |
|
Back to top |
|
|
krishh
New User
Joined: 20 May 2005 Posts: 12
|
|
|
|
hai,
a vsam file which is empty and if you want to read the empty file it is treated as unavilable.
so first open the vsam file for output and write dummy record in it. |
|
Back to top |
|
|
knd_r Currently Banned New User
Joined: 18 Mar 2005 Posts: 48
|
|
|
|
then what is the vsam status code 13? |
|
Back to top |
|
|
priya
Moderator
Joined: 24 Jul 2003 Posts: 568 Location: Bangalore
|
|
|
|
There is no VSAM Status Code 13 as for as I know.
Quote: |
if u attenpt to open an empty vsam file u will get the error 160.
to over come this write a dummy program which opens it and closes it. |
Code: |
EVALUATE VSAM-STATUS-CODE
003300 WHEN '00' DISPLAY 'SUCCESSFUL COMPLETION'
003400 WHEN '02' DISPLAY 'DUPLICATE KEY, NON UNIQ. ALT INDX'
003500 WHEN '04' DISPLAY 'READ, WRONG LENGTH RECORD'
003600 WHEN '05' DISPLAY 'OPEN, FILE NOT PRESENT'
003700 WHEN '07' DISPLAY 'CLOSE OPTION INCOMPAT FILE DEVICE'
003800 DISPLAY 'OPEN IMPLIES TAPE; TAPE NOT USED'
003900 WHEN '10' DISPLAY 'END OF FILE'
004000 WHEN '14' DISPLAY 'RRN > RELATIVE KEY DATA'
004100 WHEN '20' DISPLAY 'INVALID KEY VSAM KSDS OR RRDS'
004200 WHEN '21' DISPLAY 'SEQUENCE ERROR, ON WRITE'
004300 DISPLAY 'OR CHANGING KEY ON REWRITE'
004400 WHEN '22' DISPLAY 'DUPLICATE KEY'
004500 WHEN '23' DISPLAY 'RECORD OR FILE NOT FOUND'
004600 WHEN '24' DISPLAY 'BOUNDARY VIOLATION.'
004700 DISPLAY 'WRITE PAST END OF KSDS RECORD '
004800 DISPLAY 'COBOL 370: REL: REC# TOO BIG'
004900 DISPLAY 'OUT OF SPACE ON KSDS/RRDS FILE'
005000 WHEN '30' DISPLAY 'PERMANENT DATA ERROR'
005100 DISPLAY 'DATA CHECK, PARITY CHK, HARDW'
005200 WHEN '34' DISPLAY 'BOUNDARY VIOLATION'
005300 DISPLAY 'WRITE PAST END OF ESDS RECORD'
005400 DISPLAY 'OR NO SPACE TO ADD KSDS/RRDS RECORD'
005500 DISPLAY 'OUT OF SPACE ON SEQUENTIAL FILE'
005600 WHEN '35' DISPLAY 'OPEN, FILE NOT PRESENT'
005700 WHEN '37' DISPLAY 'OPEN MODE INCOMPAT WITH DEVICE'
005800 WHEN '38' DISPLAY 'OPENING FILE CLOSED WITH LOCK'
005900 WHEN '39' DISPLAY 'OPEN, FILE ATTRIB CONFLICTING'
006000 WHEN '41' DISPLAY 'OPEN, FILE IS OPEN'
006100 WHEN '42' DISPLAY 'CLOSE, FILE IS CLOSED'
006200 WHEN '43' DISPLAY 'DELETE OR REWRITE & NO GOOD READ FIRST'
006300 WHEN '44' DISPLAY 'BOUNDARY VIOLATION/REWRITE REC TOO BIG'
006400 WHEN '46' DISPLAY 'SEQUENTIAL READ WITHOUT POSITIONING'
006500 WHEN '47' DISPLAY 'READING FILE NOT OPEN AS INPUT/IO/EXTEND'
006600 WHEN '48' DISPLAY 'WRITE WITHOUT OPEN IO'
006700 WHEN '49' DISPLAY 'DELETE OR REWRITE WITHOUT OPEN IO'
006800 WHEN '90' DISPLAY 'UNKNOWN'
006900 WHEN '91' DISPLAY 'VSAM - PASSWORD FAILURE'
007000 WHEN '92' DISPLAY 'LOGIC ERROR/OPENING AN OPEN FILE'
007100 DISPLAY 'OR READING OUTPUT FILE'
007200 DISPLAY 'OR WRITE INPUT FILE'
007300 DISPLAY 'OR DEL/REW BUT NO PRIOR READ'
007400 WHEN '93' DISPLAY 'VSAM - VIRTSTOR. RESOURCE NOT AVAILABLE'
007500 WHEN '94' DISPLAY 'VSAM - SEQUENTIAL READ AFTER END OF FILE'
007600 DISPLAY 'OR NO CURRENT REC POINTER FOR SEQ'
007700 WHEN '95' DISPLAY 'VSAM - INVALID FILE INFORMATION'
007800 DISPLAY 'OR OPEN OUTPUT (LOAD) '
007900 DISPLAY 'WITH FILE THAT NEVER CONTNED DATA'
008000 WHEN '96' DISPLAY 'VSAM - MISSING DD STATEMENT IN JCL'
008100 WHEN '97' DISPLAY 'VSAM - OPEN OK, FILE INTEGRITY VERIFIED'
008200 DISPLAY 'FILE SHOULD BE OK'
008300 WHEN OTHER DISPLAY 'UNKNOWN REASON' VSAM-STATUS-CODE
008400 END-EVALUATE.
008800
008801* From http://www.theamericanprogrammer.com commercial use
008802* or resale of this document is a violation of copyright laws.
008900 EVALUATE-VSAM-EXTENDED-RETURN-CODE.
009000 EVALUATE VSAM-EXTENDED-RETURN-CODE
009100 WHEN 0 DISPLAY 'SUCCESSFUL COMPLETION'
009200 WHEN 4 DISPLAY 'ANOTHER REQUEST IS ACTIVE'
009300 WHEN 8 DISPLAY 'THERE IS A LOGICAL ERROR'
009400 PERFORM EVALUATE-LOGICAL-ERROR
009500 WHEN 12 DISPLAY 'THERE IS A PHYSICAL ERROR'
009600 PERFORM EVALUATE-PHYSICAL-ERROR
009700 WHEN OTHER DISPLAY 'UNKNOWN REASON'
009800 END-EVALUATE.
009900
010000 EVALUATE-VSAM-EXTENDED-FUNCTION-CODE.
010100 EVALUATE VSAM-EXTENDED-FUNCTION-CODE
010200 WHEN 0 DISPLAY 'ACCESSING BASE CLUSTER, NO PROBLEM'
010300 WHEN 1 DISPLAY 'ACCESSING BASE CLUSTER, MAY BE A PROBLEM'
010400 WHEN 2 DISPLAY 'ACCESSING ALTERNATE INDEX, NO PROBLEM'
010500 WHEN 3 DISPLAY 'ACCESSING ALTERNATE INDEX, MAY BE A PROBLEM'
010600 WHEN 4 DISPLAY 'UPGRADE PROCESSING, NO PROBLEM'
010700 WHEN 5 DISPLAY 'UPGRADE PROCESSING, MAY BE A PROBLEM'
010800 WHEN OTHER DISPLAY 'UNKNOWN REASON'
010900 END-EVALUATE.
011000
011100 EVALUATE-PHYSICAL-ERROR.
011200* USE THIS WHEN THERE IS RC 12 IN VSAM-EXTENDED-RETURN-CODE
011300 EVALUATE VSAM-EXTENDED-FEEDBACK-CODE
011400 WHEN 4 DISPLAY 'READ ERROR ON DATA'
011500 WHEN 8 DISPLAY 'READ ERROR ON INDEX'
011600 WHEN 12 DISPLAY 'READ ERROR IN SEQUENCE SET'
011700 WHEN 16 DISPLAY 'WRITE ERROR ON DATA'
011800 WHEN 20 DISPLAY 'WRITE ERROR ON INDEX'
011900 WHEN 24 DISPLAY 'WRITE ERROR IN SEQUENCE SET'
012000 WHEN OTHER DISPLAY 'UNKNOWN REASON'
012100 END-EVALUATE.
012200
012300 EVALUATE-LOGICAL-ERROR.
012400* USE THIS WHEN THERE IS RC 8 IN VSAM-EXTENDED-RETURN-CODE
012500 EVALUATE VSAM-EXTENDED-FEEDBACK-CODE
012600 WHEN 4 DISPLAY 'READ PAST END OF FILE'
012700 WHEN 8 DISPLAY 'DUPLICATE KEY'
012800 WHEN 12 DISPLAY 'KEY SEQUENCE ERROR'
012900 WHEN 16 DISPLAY 'NOT FOUND'
013000 WHEN 20 DISPLAY 'CONTROL INTERVAL IN USE BY OTHER JOB'
013100 WHEN 24 DISPLAY 'VOLUME CANNOT BE MOUNTED'
013200 WHEN 28 DISPLAY 'UNABLE TO EXTEND DATASET'
013300 WHEN 32 DISPLAY 'RBA NOT FOUND'
013400 WHEN 36 DISPLAY 'KEY IS NOT IN A DEFINED KEY RANGE'
013500 WHEN 40 DISPLAY 'INSUFFICIENT VIRTUAL STORAGE'
013600 WHEN 64 DISPLAY 'NO AVAILABLE STRINGS'
013700 WHEN 68 DISPLAY 'OPEN DID NOT SPECIFY PROC TYPE'
013800 WHEN 72 DISPLAY 'KEY ACCESS TO ESDS OR RRDS'
013900 WHEN 76 DISPLAY 'ATTEMPTED INSERT TO WRONG TYPE DATASET'
014000 WHEN 80 DISPLAY 'ATTEMPTED DELETE FROM ESDS'
014100 WHEN 84 DISPLAY 'OPTCD LOC FOR PUT REQUEST'
014200 WHEN 88 DISPLAY 'POSITION NOT ESTABLISHED'
014300 WHEN 92 DISPLAY 'PUT WITHOUT GET FOR UPDATE'
014400 WHEN 96 DISPLAY 'TRYING TO CHANGE PRIMARY KEY'
014500 WHEN 100 DISPLAY 'TRYING TO CHANGE LRECL'
014600 WHEN 104 DISPLAY 'INVALID RPL OPTIONS'
014700 WHEN 108 DISPLAY 'INVALID LRECL'
014800 WHEN 112 DISPLAY 'INVALID KEY LENGTH'
014900 WHEN 116 DISPLAY 'VIOLATED LOAD MODE RESTRICTION'
015000 WHEN 120 DISPLAY 'WRONG TASK SUBMITTING REQUEST'
015100 WHEN 132 DISPLAY 'TRYING TO GET SPANNED REC IN LOC MODE'
015200 WHEN 136 DISPLAY 'TRYING TO GET SPANNED REC BY ADDRESS'
015300 DISPLAY 'IN KSDS'
015400 WHEN 140 DISPLAY 'INCONSISTENT SPANNED REC'
015500 WHEN 144 DISPLAY 'ALT INDEX POINTER WITH NO MATCHING'
015600 DISPLAY 'BASE RECORD'
015700 WHEN 148 DISPLAY 'EXCEEDED MAX POINTERS IN ALT INDEX REC'
015800 WHEN 152 DISPLAY 'INSUFFICIENT BUFFERS AVAILABLE'
015900 WHEN 156 DISPLAY 'INVALID CONTROL INTERVAL'
016000 WHEN 192 DISPLAY 'INVALID RELATIVE REC NUMBER'
016100 WHEN 196 DISPLAY 'ATTEMPTED ADDRESSED REQUEST TO RRDS'
016200 WHEN 200 DISPLAY 'INVALID ACCESS THROUGH A PATH'
016300 WHEN 204 DISPLAY 'PUT IN BACKWARD MODE'
016400 WHEN 208 DISPLAY 'INVALID ENDREQ MACRO'
016500 WHEN OTHER DISPLAY 'UNKNOWN REASON'
016600 END-EVALUATE. |
|
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I'm curious to know how this situation could ever happen? I have never heard of a shop that would allow a new VSAM file definition to be run without a step to initialize the index-key to low-values. Is this not a standard practice, or are these questions more academic than real-world? |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
There can be 2 kinds of "empty" VSAM files. Files that never contained data and files that did but was later deleted.
Attempting to READ the 1st type results in an error condition; READing the 2nd type results in an EOF condition on the 1st READ. |
|
Back to top |
|
|
kanak
Moderator
Joined: 12 Mar 2005 Posts: 252 Location: India
|
|
|
|
hi jack,
one query, like you said
Quote: |
There can be 2 kinds of "empty" VSAM files. Files that never contained data and files that did but was later deleted.
Attempting to READ the 1st type results in an error condition; |
but when VSAM file is defined previously some where else and no data is loaded into that, but all index and data part for it's cluster is created successfully , then also will it give error while reading in program or it will show EOF.
Please clear my doubt...
thanks in advance |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Kanak,
I don't understand:
Quote: |
then also will it give error while reading in program or it will show EOF.
|
How can it do both? |
|
Back to top |
|
|
kanak
Moderator
Joined: 12 Mar 2005 Posts: 252 Location: India
|
|
|
|
hi jack,
i mean to say that what will happen.
will it give error??? OR it will show EOF???.
Hope now you are clear with my doubt. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Kanak,
Any VSAM file that has never contained data cannot be successfully READ.
If a VSAM file contained data at some point in the past (i.e. records were written to it) and that data was later deleted, you could successfully READ the file but you would encounter an EOF condition on the 1st READ (SC=10).
A similar condition exists when flat files are empty. They can be uninitialized (allocated, but never successfully OPENed and CLOSEd) or they can be functioning but empty files. |
|
Back to top |
|
|
kanak
Moderator
Joined: 12 Mar 2005 Posts: 252 Location: India
|
|
|
|
thanks jack for ur reply.Now got more better idea abt VSAM. |
|
Back to top |
|
|
akatast
New User
Joined: 05 Mar 2009 Posts: 15 Location: Ohio
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
It is more productive to reply to currently active topics rather than one that has been inactive for over 4 years
Enjoy the forum,
d |
|
Back to top |
|
|
bajibabu
New User
Joined: 01 Aug 2005 Posts: 5 Location: hyderabad
|
|
|
|
you will get vsam file status 35. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Dick - I can read your post, can others? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Anuj,
Most can - many don't
We can only try. . .
d |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1050 Location: Richmond, Virginia
|
|
|
|
You mean I waded thru all of this again for
Quote: |
Dick - I can read your post, can others? |
and
Quote: |
Most can - many don't |
? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Phil,
Wade if ya wanna. . . we won't charge any extra
I tend to scrool down to the most current posts and then (if needed) look at the earlier stuff. . .
d |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
"scrool" - I imagine you meant scroll, but thinking about it, "scrool" could be a pretty cool word. We just need to think of a real good definition for it - like "screaming drool" or "school rules" or ... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Yup, went keylexic - wrong double-letter. . . and they're so close on the keyboard . . . |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
As soon as the program gains control, issue a CALL to IKJEFT01, building a PRINT INDATASET('YOUR.VSAM.FILE') COUNT(0) TSO command.
To make things easier, pass the DSN in a PARM card and let the program extract the DSN.
Upon return from IKJEFT01, if the LASTCC=0, then the file has data or had a record (or multiple records) written to it at one time and its/they've been deleted. It can then be opened as INPUT or I-O.
If the LASTCC=4, then the file is truly < EMPTY > and it needs to be opened as OUTPUT.
If the LASTCC is other than 0 and other than 4, then you've got other problems, such as the file is open/enabled to CICS.
You'll get several hundred hits for "IKJEFT01" when searched-for on all the IBMMAINFRAME forums.
You can experiment with the PRINT INDATASET('YOUR.VSAM.FILE') COUNT(0) TSO command after exiting ISPF, then followed by the Ready prompt and from here you can enter the command.
HTH....
Bill |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
I don't know ... I like the sound of
Quote: |
When I read the post asking for __________ , I scrooled. |
You can fill in the blank appropriately. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Yup, went keylexic - wrong double-letter. . . and they're so close on the keyboard |
Funny coincidence. I was just listening to NPR in my car and they were talking about funny "autocorrections" where the "smart" phone changes words you type to other words. They had some funny examples like changing Taos to Tacos, babe to baboon, and princess to primate. They said there's even a website dedicated to it. |
|
Back to top |
|
|
|