View previous topic :: View next topic
|
Author |
Message |
girishms
New User
Joined: 06 Jun 2008 Posts: 21 Location: chennai
|
|
|
|
Hi,
Can anybody tell me how to call a cobol program from assembler program ??
Thanks,
Girish |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Statically (VCON) or Dynamically (ADCON)?
Batch or CICS?
Bill |
|
Back to top |
|
|
girishms
New User
Joined: 06 Jun 2008 Posts: 21 Location: chennai
|
|
|
|
statically i want to call it and its Batch processing , not cics |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
How many individual parms are you passing to the COBOL program?
Bill |
|
Back to top |
|
|
girishms
New User
Joined: 06 Jun 2008 Posts: 21 Location: chennai
|
|
|
|
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 |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
@ 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 |
|
|
girishms
New User
Joined: 06 Jun 2008 Posts: 21 Location: chennai
|
|
|
|
Thanks... |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi Robert !
Who did you mean ??? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
UmeySan: actually, I was referring to the original question ... but it can apply as needed, of course! |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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.
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.
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
Just my .02 cents....
Bill |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
Non-LE compliant Assembler Calling LE-compliant COBOL.
Apples and Oranges as they say. |
or even Apples and Pomegranates? |
|
Back to top |
|
|
|