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
 

 

VSAM File not opening in I-O Mode
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
swathiravichandran

New User


Joined: 21 Jul 2008
Posts: 19
Location: Mumbai

PostPosted: Fri Sep 26, 2008 9:33 pm    Post subject: VSAM File not opening in I-O Mode
Reply with quote

Hi,

I am trying to open and read a vsam file .I have used it in I-O mode .It is opening the file successfully but not reading any value . Can anyone please help me out with it ?

I initialized the code with this layout
SELECT I-O-FILE ASSIGN TO OFILE1
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS ABCD.
FILE STATUS IS WS-VSAM-STATUS.

READ I-O-FILE.
IF VSAM-SUCCESSFUL
PERFORM 2600-CHK-PARA THRU 2600-EXIT
ELSE
DISPLAY 'VSAM UN-SUCCESFUL'
GO TO 2600-EXIT
END-IF.
Back to top
View user's profile Send private message

swathiravichandran

New User


Joined: 21 Jul 2008
Posts: 19
Location: Mumbai

PostPosted: Fri Sep 26, 2008 9:41 pm    Post subject: VSAM FILE STATUS 47
Reply with quote

Hi,
While reading my vsam file in I-O-mode, I am getting vsam file status 47.
wat does it mean.?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Fri Sep 26, 2008 9:57 pm    Post subject: Reply to: VSAM FILE STATUS 47
Reply with quote

that You did not care to look at the manual for the vsam file status meaning
is Your other post related to the same issue ???

please do not double post,
You will not get a double help or the same help in half the time

let me know and I will delete one of the two
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Sep 26, 2008 10:05 pm    Post subject:
Reply with quote

swathiravichandran wrote:
I have used it in I-O mode .It is opening the file successfully but not reading any value .
Apparently not.....
swathiravichandran wrote:
While reading my vsam file in I-O-mode, I am getting vsam file status 47.
wat does it mean.?
Look it up.....
47
The execution of a READ statement was attempted on a file not open in the input or I-O mode.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Sat Sep 27, 2008 4:28 am    Post subject: Re: VSAM File not opening in I-O Mode
Reply with quote

swathiravichandran wrote:
It is opening the file successfully ..
How do you conclude this ? Status code posted doesn't support this explanation. Was the VSAM defined correctly ?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Sat Sep 27, 2008 5:12 am    Post subject:
Reply with quote

swathiravichandran: I notice you did not post the OPEN statement you used with the file. This is highly important data for your problem. And, by the way, if you open the file for OUTPUT it may very well open successfully but when you attempt to READ from such a file you will get a file status 47 set on the READ, even though the OPEN file status was 00.
Back to top
View user's profile Send private message
ramakrishnag

New User


Joined: 10 Sep 2008
Posts: 6
Location: india

PostPosted: Sat Sep 27, 2008 8:02 pm    Post subject: Reply to: VSAM File not opening in I-O Mode
Reply with quote

Hi Swathi,

For read and update VSAM file
Frist thing open I-O mode that you aready done.
Next pass the KEy values in ABCD
then read the VSAM file if record is found then WS-file -STATus will be 00 other wise 10 record not found.
for update use re-write command but make sure that key values in ABCD should not be changed.
Hope this will solve your problem

Thanks,
Rama
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Sat Sep 27, 2008 10:19 pm    Post subject: Re: Reply to: VSAM File not opening in I-O Mode
Reply with quote

Hi Rama,
ramakrishnag wrote:
Frist thing open I-O mode that you aready done.
How could you know this, She has just given the file-name as I-O-FILE and that doesn't conclude that file is/was actually OPENed in I-O mode. We would need to know how does the OPEN statement look like, as asked by Robert. Unless I misunderstood or there is other way please let me know.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Sun Sep 28, 2008 1:45 am    Post subject:
Reply with quote

Hello swathiravichandran,

Did you miss the example & link of this thread..

http://www.ibmmainframes.com/viewtopic.php?t=34651&highlight=
Back to top
View user's profile Send private message
ridgewalker58

New User


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

PostPosted: Sun Sep 28, 2008 4:03 am    Post subject: Reply to: VSAM File not opening in I-O Mode
Reply with quote

If what you mean by "opens successfully" is that you are receiving a File status code of ZEROS, then:
1. If the file has records of varying sizes, and you are only describing
one 01 LEVEL, try adding a second 01 LEVEL for the MAXIMUM size
of the possible records.
FOR EXAMPLE: VSAM DEFINITION RECSIZE (15 4096)
Make two 01 levels 01 REC1 PIC X(15).
01 REC2 PIC X(4096).
** If you described ONE 01 level and you encounter a different
size record - depending on your compiler - you will get an
error.
2. OR if the file is EMPTY and you try to open it with I-O you should
have gotten an INVALID open file status code.
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 10:45 am    Post subject:
Reply with quote

This is my open statement 'OPEN I-O I-O-FILE.' which I have coded before i m reading the file.But still facing the same problem.The record key I mentioned as ABCD which i m using as a key in my vsam file.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Mon Sep 29, 2008 10:54 am    Post subject:
Reply with quote

Ok, try to DISPLAY the status code after READ..& tell us what comes up..

Code:
READ I-O-FILE.
IF VSAM-SUCCESSFUL
    DISPLAY 'WS-VSAM-STATUS='WS-VSAM-STATUS
ELSE
    DISPLAY 'VSAM UN-SUCCESFUL'
END-IF.
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 11:05 am    Post subject:
Reply with quote

VSAM UN-SUCCESFUL
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Mon Sep 29, 2008 11:21 am    Post subject:
Reply with quote

Hi,

Please post the scrap of code where you issuse an OPEN, was it in PROCEDURE DIVISION or not ? Please post a code in a manner that we can understand the logical flow of the program. I suspect you tried to READ file before it was OPENed.
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 11:37 am    Post subject:
Reply with quote

OPEN I-O I-O-FILE.
DISPLAY 'OPENING I-O-FILE'.
READ I-O-FILE.
DISPLAY 'READING I-O-FILE'.

IF VSAM-SUCCESSFUL
DISPLAY 'VSAM-STATUSCODE' WS-VSAM-STATUS
DISPLAY 'VSAM SUCCESFUL FOR 2600-PARA'
PERFORM 2600-CHK-PARA THRU 2600-EXIT
ELSE
DISPLAY 'VSAM UN-SUCCESFUL'
DISPLAY 'VSAM-STATUSCODE' WS-VSAM-STATUS
GO TO 2500-EXIT
END-IF.
Back to top
View user's profile Send private message
ramakrishnag

New User


Joined: 10 Sep 2008
Posts: 6
Location: india

PostPosted: Mon Sep 29, 2008 11:54 am    Post subject: Reply to: VSAM File not opening in I-O Mode
Reply with quote

Hi Swathi,

Can you tell one thing.

1. Are you define the 05 WS-VSAM-STATUS PIC 9(02).
and the 88 VSAM-SUCCESSFUL value 00.

2. In the JOB are you mentioned VSAM file which has record lenght equal to the file section record length only or seqential file ?.

Check these to things and let us know.

thanks,
Rama
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 1:55 pm    Post subject:
Reply with quote

what will be the access mode for a file being opened in I-O mode and is a KSDS 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 2:00 pm    Post subject:
Reply with quote

Hi Rama,
1.I declared as 05 WS-VSAM-STATUS PIC X(02).
and the 88 VSAM-SUCCESSFUL value '00', '97'.
2.Yes the record length in both the job and file are same.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Mon Sep 29, 2008 2:18 pm    Post subject:
Reply with quote

swathiravichandran wrote:
what will be the access mode for a file being opened in I-O mode and is a KSDS VSAM file.
INDEXED.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Mon Sep 29, 2008 2:27 pm    Post subject:
Reply with quote

Well, we are not making progress. So far it seems code does have all the ingredients, let's check the VSAM definition now - how the VSAM was created, do you have IDCAMS code lines available to share.
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 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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
This topic is locked: you cannot edit posts or make replies. Natural ADABAS Opening with CTS enikhilk Mainframe Jobs 0 Wed Nov 30, 2016 5:37 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 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


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