IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Dynamic CALL in COBOL vs. LINK in Assembler


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Wed Feb 07, 2007 5:14 am
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: 3156
Location: Tucson AZ

PostPosted: Wed Feb 07, 2007 5:29 am
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

Moderator Emeritus


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

PostPosted: Wed Feb 07, 2007 7:04 am
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
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

Moderator Emeritus


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

PostPosted: Wed Feb 07, 2007 7:21 am
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: 3156
Location: Tucson AZ

PostPosted: Wed Feb 07, 2007 7:26 am
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

Moderator Emeritus


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

PostPosted: Wed Feb 07, 2007 7:32 am
Reply with quote

Hello again,

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

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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top