Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Call a cobol program dynamically from a assembler

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
rssprasadin

New User


Joined: 22 Aug 2008
Posts: 5
Location: Chennai

PostPosted: Fri Aug 22, 2008 6:04 pm    Post subject: Call a cobol program dynamically from a assembler
Reply with quote

I need to call a cobol program dynamically from a assembler program with a parm of 80
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


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

PostPosted: Fri Aug 22, 2008 6:18 pm    Post subject:
Reply with quote

Hi,

I do not speak assembler much, little did I know..

1. You can issue a CALL macro call in your Assembler program. With this method you also need to include an INCLUDE command in a link file for the module you want to link to. When the Linker processes the INCLUDE command, it does not actually include the COBOL module, but instead generates and includes a small Assembler module. When the CALL is executed at run time, the Assembler module loads and links to the COBOL module.

2. You can issue a LOAD macro call in your Assembler program. Again, the LOAD macro does not load the COBOL module directly, but instead creates and loads an Assembler module the address of which is returned by the LOAD. You then issue a BALR instruction specifying this address. The Assembler module then performs the dynamic link to the COBOL module. Note that if you use this option you must set the high bit in the last parameter address to the number of parameters being passed so that the COBOL program can determine the correct number of parameters.
Back to top
View user's profile Send private message
rssprasadin

New User


Joined: 22 Aug 2008
Posts: 5
Location: Chennai

PostPosted: Fri Aug 22, 2008 6:29 pm    Post subject:
Reply with quote

THX Anuj. I have already used LOAD and BALR. my program is running after using LM R14,R3,SAVEAREA+4, but R1 has the parameter. after using that code my all registers are correpted except R15. please help
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8201
Location: East Dubuque, Illinois, USA

PostPosted: Fri Aug 22, 2008 8:01 pm    Post subject:
Reply with quote

If you haven't reviewed the manual Writing ILC Applications SA22-7563, you need to do so. There's an entire chapter on calling COBOL programs from Assembler, with details on LE-conforming and non-LE-conforming routines.
Back to top
View user's profile Send private message
rssprasadin

New User


Joined: 22 Aug 2008
Posts: 5
Location: Chennai

PostPosted: Sat Aug 23, 2008 7:13 pm    Post subject:
Reply with quote

i am getting the error
A storage reference exception, S0C4, occurred during execution of
program CEEVGTUN.

my code is

Code:
         LOAD  EP=Z17DIST,ERRET=ERROR1      Load the programs           
         ST    R0,Z17ADDR                              Store Addr
*        EIF                                           
         OI    Z17LOAD,X'01'                           
CALL_Z17 SR    R5,R5                                   
         LA    R5,FILLER-Z17STDT                       
         ST    R5,Z17LENGTH                            calculate the length
         SR    R5,R5                                   
         LA    R5,Z17STDT                             
         ST    R5,Z17START                             
         STM   R0,R15,SVAREA+4                         
         ST    R0,SVAREA                               
         LM    R15,R3,SVAREA                           
         L     R15,Z17ADDR                             
*        LA    R1,Z17START                             
         LA    R1,Z17PARM                             
        BASSM R14,R15
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 -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts ICETOOL - RESIZE DYNAMICALLY kranthikumarb DFSORT/ICETOOL 0 Tue Nov 21, 2017 5:30 pm
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 8 Wed Nov 15, 2017 4:27 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us