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
 
calling a cobol program from assembler

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

New User


Joined: 06 Jun 2008
Posts: 21
Location: chennai

PostPosted: Tue Jul 22, 2008 5:16 pm    Post subject: calling a cobol program from assembler
Reply with quote

Hi,

Can anybody tell me how to call a cobol program from assembler program ??

Thanks,
Girish
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Tue Jul 22, 2008 5:19 pm    Post subject: Re: calling a cobol program from assembler
Reply with quote

Statically (VCON) or Dynamically (ADCON)?

Batch or CICS?

Bill
Back to top
View user's profile Send private message
girishms

New User


Joined: 06 Jun 2008
Posts: 21
Location: chennai

PostPosted: Tue Jul 22, 2008 5:23 pm    Post subject: calling a cobol program from assembler
Reply with quote

statically i want to call it and its Batch processing , not cics
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Tue Jul 22, 2008 5:29 pm    Post subject: Re: calling a cobol program from assembler
Reply with quote

How many individual parms are you passing to the COBOL program?

Bill
Back to top
View user's profile Send private message
girishms

New User


Joined: 06 Jun 2008
Posts: 21
Location: chennai

PostPosted: Tue Jul 22, 2008 5:32 pm    Post subject:
Reply with quote

HI ,

I dont have any idea about it rite now . but wat i want to test is that an assembler program should call a cobol program with some parameters to be passed to it .

thanks,
Girish
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Tue Jul 22, 2008 6:33 pm    Post subject:
Reply with quote

@ girishms !

So ok, here's a little example. Pgm MDL90500 /Assembler is calling Pgm 50330 / Cobol and passing a ParameterList.

First EntryPoint is loaded. Only once. Then Parameters are prepared.
Then Programm is called. Afterwards rc is che

IF (MDL50330_ADRS,Z,MDL50330_ADRS,OC)
THEN C='PROGRAMM NOCH NICHT GELADEN'
LOAD EP=MDL50330
ST R0,MDL50330_ADRS ...store adress
EIF

MVC MDL50330§FUC,=H'000' ...Serve a parameter-Field
MVC MDL50330§MNR,=H'2600' ...Serve a parameter-Field


SR R5,R5 ...length of parm
LA R5,MDL50330§UEND-MDL50330§UANF ...end - start = length
ST R5,MDL50330§LENG

SR R5,R5
LA R5,MDL50330§UANF ...PARM-START-ADRESSE
ST R5,MDL50330§PADR ...ADR PARM-LEISTE


STM R0,R15,CHCKVEPA_WORK ...Save all register

L R15,MDL50330_ADRS ...R15=PROGRAMM ENTRYPOINT
LA R1,MDL50330§PADR ...R01=ADRESSE of PARM ADRESSE

CHGAMODE 31,R14 ...CHANGE MODE
BASSM R14,R15 ...CALL THE COBOL ABOVE
CHGAMODE 24,R14 ...CHANGE MODE

LM R0,R15,CHCKVEPA_WORK ...reload all register


IF MDL50330§RTX+04(04),EQ,=C'NEIN',CLC
THEN C=Check ReturnCodes or whatever is needed'
MVI ERROR,ON
EIF




MDL50330_ADRS DC 1A(0) ...entrypoint of sub-pgm
MDL50330§PADR DC 1A(0) ...adr of parm (MDL50330§UANF)
MDL50330§LENG DC 1F'0' ...length of parm (UEND-UANF)

MDL50330§UANF DS 0C ...start parameters

MDL50330§FUC DC HL002'0'
MDL50330§LEN DC HL002'0'
MDL50330§UMG DC CL004' '
MDL50330§FEH DC CL001' '
MDL50330§MOD DC CL008'40'
MDL50330§MNR DC XL002'00'
MDL50330§RCD DC XL002'00'
MDL50330§ROD DS CL008' '
MDL50330§RNR DC XL002'00'
MDL50330§RTX DC CL060' '

MDL50330§UEND DS 0F ...end parameters
Back to top
View user's profile Send private message
girishms

New User


Joined: 06 Jun 2008
Posts: 21
Location: chennai

PostPosted: Tue Jul 22, 2008 8:05 pm    Post subject:
Reply with quote

Thanks...
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Jul 22, 2008 8:14 pm    Post subject:
Reply with quote

If you're serious about this, reference the manual for your version of z/OS:
Quote:
z/OS

Language Environment
Writing Interlanguage
Communication Applications

Document Number SA22-7563
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Tue Jul 22, 2008 8:18 pm    Post subject:
Reply with quote

Hi Robert !

Who did you mean ???
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Jul 22, 2008 8:21 pm    Post subject:
Reply with quote

UmeySan: actually, I was referring to the original question ... but it can apply as needed, of course!
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Wed Jul 23, 2008 6:52 am    Post subject: Re: calling a cobol program from assembler
Reply with quote

Robert,

I think you've hit the main problem and I'm assuming that girishms
is dealing with the following scenario -

Non-LE compliant Assembler Calling LE-compliant COBOL.

Apples and Oranges as they say. icon_exclaim.gif

At the very least, the Assembler Caller (if not LE-compliant) needs to establish an LE-Environment first via CEEPIPI or the shop needs to bite the bullet and make the calling-program completely LE-compliant.

IMHO, LE-compliant (or non LE-compliant) COBOL calling non-LE compliant Assembler is generally the rule with some of these Assembler programs having been around for (dare say) longer than the age of some of our members. icon_wink.gif

Unless the Assembler program needs to call LE Service routines, the program can remain as-is, except, don't corrupt R12, because it contains the LE-compliant HLL "CAA" (Common Anchor Area). I usually ward-off anyone with -

Code:

         CEECAA                    LE 'COMMON ANCHOR AREA' DSECT         
         USING CEECAA,R12          R12 IS 'OFF LIMITS'                   

even though I don't address any of the labels and use R3 as a CSECT Base.

Seems to work icon_wink.gif

Just my .02 cents....

Bill
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed Jul 23, 2008 7:18 am    Post subject:
Reply with quote

Quote:
Non-LE compliant Assembler Calling LE-compliant COBOL.

Apples and Oranges as they say.
or even Apples and Pomegranates?
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

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