Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

What will happen if empty vsam file is opened for input
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
knd_r
Currently Banned

New User


Joined: 18 Mar 2005
Posts: 48

PostPosted: Mon May 23, 2005 11:35 am    Post subject: What will happen if empty vsam file is opened for input
Reply with quote

hi,

what will happen if empty vsam file is opened for input?

bye,
ks reddy.
Back to top
View user's profile Send private message

kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Mon May 23, 2005 11:57 am    Post subject:
Reply with quote

nothing, when u will try to read on the first read only it will give eof reached.
Back to top
View user's profile Send private message
krishh

New User


Joined: 20 May 2005
Posts: 12

PostPosted: Mon May 23, 2005 6:44 pm    Post subject:
Reply with quote

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
View user's profile Send private message
knd_r
Currently Banned

New User


Joined: 18 Mar 2005
Posts: 48

PostPosted: Mon May 23, 2005 7:27 pm    Post subject:
Reply with quote

then what is the vsam status code 13?
Back to top
View user's profile Send private message
priya

Moderator


Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

PostPosted: Mon May 23, 2005 10:27 pm    Post subject:
Reply with quote

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
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue May 24, 2005 1:55 am    Post subject: Re: What will happen if empty vsam file is opened for input
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue May 24, 2005 6:24 am    Post subject:
Reply with 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; READing the 2nd type results in an EOF condition on the 1st READ.
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Tue May 24, 2005 9:40 am    Post subject:
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed May 25, 2005 6:08 am    Post subject:
Reply with quote

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
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Wed May 25, 2005 9:30 am    Post subject:
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Thu May 26, 2005 5:52 am    Post subject:
Reply with quote

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
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Thu May 26, 2005 9:39 am    Post subject:
Reply with quote

thanks jack for ur reply.Now got more better idea abt VSAM.
Back to top
View user's profile Send private message
akatast

New User


Joined: 05 Mar 2009
Posts: 15
Location: Ohio

PostPosted: Fri Jul 31, 2009 7:45 pm    Post subject: Reply to: What will happen if empty vsam file is opened for
Reply with quote

@Priya,
VSAM Status Code 13 is there and I got that once. go througt this link http://www.simotime.com/vsmfsk01.htm
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Aug 01, 2009 6:12 am    Post subject: Reply to: What will happen if empty vsam file is opened for
Reply with quote

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 icon_smile.gif

Enjoy the forum,

d
Back to top
View user's profile Send private message
bajibabu

New User


Joined: 01 Aug 2005
Posts: 5
Location: hyderabad

PostPosted: Thu Jan 13, 2011 12:55 pm    Post subject: Reply to: What will happen if empty vsam file is opened for
Reply with quote

you will get vsam file status 35.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jan 13, 2011 1:00 pm    Post subject:
Reply with quote

Dick - I can read your post, can others? icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jan 13, 2011 8:38 pm    Post subject: Reply to: What will happen if empty vsam file is opened for
Reply with quote

Hi Anuj,

Most can - many don't icon_wink.gif

We can only try. . .

d
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 961
Location: Richmond, Virginia

PostPosted: Thu Jan 13, 2011 10:38 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jan 14, 2011 12:45 am    Post subject: Reply to: What will happen if empty vsam file is opened for
Reply with quote

Hi Phil,

Wade if ya wanna. . . we won't charge any extra icon_cool.gif

I tend to scrool down to the most current posts and then (if needed) look at the earlier stuff. . .

d
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Jan 14, 2011 2:09 am    Post subject:
Reply with quote

"scrool" - I imagine you meant scroll, but thinking about it, "scrool" could be a pretty cool word. icon_smile.gif We just need to think of a real good definition for it - like "screaming drool" or "school rules" or ...
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 -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us