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
 

 

Dynamic CALL in COBOL vs. LINK in Assembler

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
zatlas
Currently Banned

New User


Joined: 07 Dec 2006
Posts: 8
Location: Ne Jersey

PostPosted: Wed Feb 07, 2007 4:32 am    Post subject: Dynamic CALL in COBOL vs. LINK in Assembler
Reply with quote

Hi All
I have an Assembler program that does LINK EP... and refer to a system utility (IDCAMS)

I coded an equivalent COBOL program that does:

01 VAR PIC X(8).
.
.
MOVE 'IDCAMS' TO VAR
CALL VAR

I even added the SYS1.LINKLIB (where IDCAMS resides) to the STEPLIB. The program abends on S806 because it may not find IDCAMS.

Any clues please.
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: Wed Feb 07, 2007 5:14 am    Post subject:
Reply with quote

Hello,

Try CALL 'IDCAMS ' making the call static rather than dynamic. You won't want to keep that executable, but you could see if it will run.

Please post your jcl for that step and for the assembler step that works.

If i recall there are multiple reasons for an 806 - one of them is module not found, but i believe that is not the only reason. Again, from memory, i believe the 806-4 is module not found.

Good luck and keep us posted.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Feb 07, 2007 5:29 am    Post subject:
Reply with quote

Try this link: http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/dgt1v403/C.2.1?SHELF=&DT=19990113080956 Off the top of my head, it seems that the linkage requirements are going to be close to insurmountable via COBOL, but good luck trying, that is where I learned a heck of a lot of what I know (most of which I've since forgotten.. icon_rolleyes.gif I.
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: Wed Feb 07, 2007 7:04 am    Post subject:
Reply with quote

Hello,

If you have an assembler module that successfully makes the call, you could maybe strip the assembler down so that all that it did was call IDCAMS - then call your new assembler module from your COBOL code.

Just a thought - not even a suggestion really.

Good luck and keep us posted. icon_smile.gif
Back to top
View user's profile Send private message
zatlas
Currently Banned

New User


Joined: 07 Dec 2006
Posts: 8
Location: Ne Jersey

PostPosted: Wed Feb 07, 2007 7:12 am    Post subject:
Reply with quote

Thanks for the answers.
Mr. Thompson, it seems like you are correct and there is no real way to do that in COBOL although I am not sure why. Why would I need to LOAD or FETCH the program prior to CALLing it?

Is there an LE facility similar to the LOAD/FETCH that might be used from COBOL and thus help me? (this is a client project and I have to finish it ASAP!)

Thanks
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: Wed Feb 07, 2007 7:21 am    Post subject:
Reply with quote

Hello,

Needing to LOAD or FETCH may have something to do with how IDCAMS is written.

Did you try to "nest" the call - from COBOL to assembler to IDCAMS? Curious if it helped, failed the same way or found some new abend.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Feb 07, 2007 7:26 am    Post subject:
Reply with quote

I am sorry, if I can't recall fully, but there are IBM utilities that have "back door" entrances that are used by calling programs. I did not see it in the link I posted, but I can't get the thought out of my head that IDCAMS functionality is obtainable through some I-something-something module by a well-written COBOL program.

I will think about this some more and post IF and when I come up with anything.

Bill
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: Wed Feb 07, 2007 7:32 am    Post subject:
Reply with quote

Hello again,

Here's a link that shows COBOL code that calls IDCAMS.

http://www.naspa.com/PDF/2000/0100%20TS%20PDFs/T0001006.pdf

Here's a quote from someone who tried it. . .
Quote:
I was able to call IDCAMS from a COBOL program, as described in the PDF File (from naspa.com). Initially I got S0C4 Abend, because I missed DATA(24) Compiler Option. Later I succeeded and was able to store the output in a file specified in SYSPRINT. That PDF file explains the method in detail.



Give it a shot and we'll keep looking.

Good Luck!
Back to top
View user's profile Send private message
zatlas
Currently Banned

New User


Joined: 07 Dec 2006
Posts: 8
Location: Ne Jersey

PostPosted: Wed Feb 07, 2007 9:37 pm    Post subject:
Reply with quote

Thanks so much. It helps!
One question (because my mind is already overwhelmed :-) Is there any validity to AMODE24 with DATA31 or would AMODE24 actually force DATA24 as well regardless to what I say?
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 6 Thu Aug 17, 2017 7:13 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm


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