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 Read error in Easytrieve

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Aravinthkumar

New User


Joined: 09 Feb 2009
Posts: 5
Location: India

PostPosted: Sat Feb 19, 2011 5:13 pm    Post subject: VSAM Read error in Easytrieve
Reply with quote

Hi,

I am trying to write an easytrieve code which in turn calls a COBOL program to read a VSAM file. As I understand, Easytrieve automatically opens the file so that read operation can be performed. When I try to read the VSAM file through the COBOL call, the read fails with a file status of 47 (Trying to read a VSAM file that is not opened in INPUT or I-O mode). So, I even tried to open the file again through the COBOL call wherein the open was successful but the subsequent call to read the VSAM file failed with file status 47.

The reason being am trying to read the file through the COBOL call is that the code to read that particular file already exists and performs few operations on the retrieved record and our requirement is to call the existing COBOL code to achieve this instead of coding the same set of logic again.

Could someone please suggest what am I missing here?

I tried having FILE <VSAM DD name> VS in easytrieve code and without this statement as well but still getting the same file status - 47.

Is there any restriction in reading the file through a COBOL code from Easytrieve?

I can confirm that the COBOL code is perfect as this is running for long time but I couldn't find an existing Easytrieve code that calls this COBOL code.

Please let me know if any additional information is required.

Thanks & Regards,
Aravinth Kumar J.
Back to top
View user's profile Send private message

PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Sat Feb 19, 2011 7:32 pm    Post subject:
Reply with quote

Quote:

The reason being am trying to read the file through the COBOL call is that the code to read that particular file already exists and performs few operations on the retrieved record and our requirement is to call the existing COBOL code to achieve this instead of coding the same set of logic again.


Never seen such a load of crap. Why calling a cobol routine for vsam access, if Easytrev has it all?
So who ever thought out that requirement is brain dead.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Sat Feb 19, 2011 8:06 pm    Post subject:
Reply with quote

PeterHolland wrote:
Quote:

The reason being am trying to read the file through the COBOL call is that the code to read that particular file already exists and performs few operations on the retrieved record and our requirement is to call the existing COBOL code to achieve this instead of coding the same set of logic again.


Never seen such a load of crap. Why calling a cobol routine for vsam access, if Easytrev has it all?
So who ever thought out that requirement is brain dead.

Reusable code. The standard in my shop is that all I/O and data accesses are done in dynamically-linked external subroutines, and programs call those subroutines.

(Did this cause us a wee bit of trouble when we converted from MVS PL/I to Enterprise PL/I? Why yes, yes it did.)
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: Sun Feb 20, 2011 2:24 am    Post subject:
Reply with quote

Hello and welcome to the forum,

If part of "the rules" is that you must call the existing COBOL program (without changing it) you may have to tell "them" this will not work. . .
Back to top
View user's profile Send private message
Aravinthkumar

New User


Joined: 09 Feb 2009
Posts: 5
Location: India

PostPosted: Sun Feb 20, 2011 3:15 am    Post subject:
Reply with quote

dick scherrer wrote:
Hello and welcome to the forum,

If part of "the rules" is that you must call the existing COBOL program (without changing it) you may have to tell "them" this will not work. . .


Thanks Dick!!!That will be my next move but thought I can check whether I am missing something before going back.

But to confirm there isn't any problem with the COBOL code. This is called by other programs but everything coded in COBOL again. This is the first time we are trying to call it from an Easytrieve code.

Regards,
Aravinth Kumar J.
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: Sun Feb 20, 2011 9:24 am    Post subject:
Reply with quote

Hello,

Easytrieve calls COBOL code as easily as COBOL code calls COBOL code. . . However, Easytrieve is a different running environment than COBOL.

With the existing processes that work correctly, how is the vsam file OPENed? In which program(s)?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Sun Feb 20, 2011 4:10 pm    Post subject:
Reply with quote

Read the chapter "Subprograms" in the manual :
"CA-Easytrieve/Plus Reference Guide".

Beside that you can not mix Easytrev IO and called programs IO, it is or
only Easytrev or only called programs.
Back to top
View user's profile Send private message
Aravinthkumar

New User


Joined: 09 Feb 2009
Posts: 5
Location: India

PostPosted: Sun Feb 20, 2011 5:24 pm    Post subject:
Reply with quote

dick scherrer wrote:
Hello,

Easytrieve calls COBOL code as easily as COBOL code calls COBOL code. . . However, Easytrieve is a different running environment than COBOL.

With the existing processes that work correctly, how is the vsam file OPENed? In which program(s)?


Hi Dick,

The existing COBOL programs call the subprogram to perform open, read and close operations on the VSAM file. The subprogram just receives a value which tells what operation has to be perfomed on the VSAM file.

I even tried similarly from Easytrieve code to call the subprogram to open the file before performing read operation. The open was successful but the subsequent read operation failed with file status 47.

Does it has something to do with DD statement in JCL/FILE statement in Easytrieve code? jst started thinking wild icon_confused.gif

Regards,
Aravinth Kumar J.
Back to top
View user's profile Send private message
Aravinthkumar

New User


Joined: 09 Feb 2009
Posts: 5
Location: India

PostPosted: Sun Feb 20, 2011 5:26 pm    Post subject:
Reply with quote

PeterHolland wrote:
Read the chapter "Subprograms" in the manual :
"CA-Easytrieve/Plus Reference Guide".

Beside that you can not mix Easytrev IO and called programs IO, it is or
only Easytrev or only called programs.


Hi PeterHolland,

I had a look at the manual but couldn't find anything that could help me resolving this. Still scrolling the manual from top to bottom - doesn't help much. icon_surprised.gif

Regards,
Aravinth Kumar J.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Sun Feb 20, 2011 7:14 pm    Post subject:
Reply with quote

Well it says enough about Linkage conventions, parameter lists etc.

Your calling sequence could be something like this :

CALL cobolprg USING ('OPEN' 'ddname')
CALL cobolprg USING ('GET' buffer)

Maybe you need to find out which parameters are accepted by your cobol
routine.
Once again use the Easytrev vsam io handling.
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: Sun Feb 20, 2011 10:43 pm    Post subject:
Reply with quote

Hello,

I still have (at least) one confusion icon_confused.gif

If the subroutine does the open/close/read why is the vsam file referenced in the Easytrieve code? All that should be needed is the record layout. . .
Back to top
View user's profile Send private message
Aravinthkumar

New User


Joined: 09 Feb 2009
Posts: 5
Location: India

PostPosted: Mon Feb 21, 2011 5:40 pm    Post subject: Reply to: VSAM Read error in Easytrieve
Reply with quote

The environment parameter on JOB statement in Easytrieve code made the difference. As I understand from the manual, it is installation specific which can be set to either NONE or COBOL. This decides in which environment the called programs will be executed.

It was defaulted to NONE in my case and an override of COBOL to ENVIRONMENT resolved the problem.

A lesson learnt!!!

Thanks to Dick - I have now removed FILE statement in Easytrieve code and all the IO operations are taken care by the called COBOL program.

Thanks to PeterHolland - It was you who made me go back and have a fresh look at the manual to identify the culprit!!!

Regards,
Aravinth Kumar J.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Mon Feb 21, 2011 11:19 pm    Post subject:
Reply with quote

What can i say? Good luck with your requirement.
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: Tue Feb 22, 2011 1:09 am    Post subject: Reply to: VSAM Read error in Easytrieve
Reply with quote

Good to hear it is working - thank you for posting the resolution icon_smile.gif

d
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts Error during restore rename archanamuthukrishnan All Other Mainframe Topics 2 Fri Oct 14, 2016 3:30 pm
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm


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