View previous topic :: View next topic
|
Author |
Message |
Srinivas B
New User
Joined: 05 Sep 2020 Posts: 14 Location: India
|
|
|
|
Hi All,
I have a requirement where i need to call the REXX Program from Cobol and need to pass some parameters to Rexx. I am new to REXX so not sure how to call rexx program from Cobol and how to execute using JCL. I searched forums but not getting the simillar sample program. Can anybody provide sample cobol program which inturn call the REXX program with parameters and also JCL to execute the cobol programs.
Thanks in advance for your great help. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2022 Location: USA
|
|
|
|
The issue with calling COBOL from JCL has absolutely nothing to do with calling REXX from COBOL.
1) try to understand the difference
2) try to RTFM
3) try not mixing different environments for no reason, and unless you clearly understand the mechanism of their interaction
4) try to do ANY of your own attempts to do your job, and demonstrate it here |
|
Back to top |
|
|
Srinivas B
New User
Joined: 05 Sep 2020 Posts: 14 Location: India
|
|
|
|
Thanks for your reply. But my requirement is REXX module are already there which are currently executed manually based on request. We are trying to automate now. We are adding new DB2 table which will have request details and different rexx module will be executed based on the request type. So we are adding cobol program which will read this DB2 table and identifies the request type and accordingly call different rexx modules to process these requests.
Hope this clarifies.
Thanks in advance. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Try using you favorite search engine and search for: cobol calling rexx
There are several examples, including some from this forum. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Code: |
WORKING-STORAGE SECTION.
01 CALL-REXX PIC X(6) VALUE "IRXJCL" .
01 CALL-PARM.
05 PARM-LEN PIC S9(4) BINARY VALUE 8.
05 PARM-VALUE PIC X(8) VALUE "REXPROG1'.
PROCEDURE DIVISION.
CALL CALL-REXX USING CALL-PARM.
STOP RUN.
In a JCL use SYSEXEC propery. |
|
|
Back to top |
|
|
Srinivas B
New User
Joined: 05 Sep 2020 Posts: 14 Location: India
|
|
|
|
Thank you rohit. i tried this but its not calling REXX program and i am getting abend (***BAD RC*** FROM REXX=20048 ) and also we need to pass parameters to the rexx program.
Can you please provide me sample JCL and sample program which is running fine.
Thanks in Advance. |
|
Back to top |
|
|
Srinivas B
New User
Joined: 05 Sep 2020 Posts: 14 Location: India
|
|
|
|
Sorry Rohit..my Bad. Now i have changed the code as sugessted by you.
But still i am getting RC-20 from while calling REXX.
Code: |
05 WS-IRXJCL PIC X(8) VALUE 'IRXJCL'.
01 ARGUMENT.
03 ARG-LENGTH pic S9(4) BINARY VALUE 8.
03 ARG-CHAR pic x(6).
MOVE 'REXXADD' TO ARG-CHAR
CALL WS-IRXJCL USING ARGUMENT
IF RETURN-CODE NOT = 0
DISPLAY '***BAD RC*** FROM REXX=' RETURN-CODE
ELSE
DISPLAY 'REXX CALL SUCESSFULL:' RETURN-CODE
END-IF
*****************************
***BAD RC*** FROM REXX=00020 |
Can anybody help on this..
Cod'ed |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Srinivas B wrote: |
Thank you rohit. i tried this but its not calling REXX program and i am getting abend (***BAD RC*** FROM REXX=20048 ) and also we need to pass parameters to the rexx program.
Can you please provide me sample JCL and sample program which is running fine.
Thanks in Advance. |
Mostly your JCL don't have those libs that required for REXX but You will also need to look up manuals and existing jobs that do type of calls this at your site.
Please make a use of code tags as and when needed.
www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.rexa100/h1981605303.htm |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Why mix COBOL and Rexx? You can easily write a program in Rexx to do what your COBOL code is meant to do. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Agree . But based on the TS knowledge it seems he don’t know REXX ( which is fine ) and hence writing a cobol module as a wrapper to call various REXX modules based on the values in the Db2 table ( Which is fine too ). Either should work. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2022 Location: USA
|
|
|
|
Rohit Umarjikar wrote: |
Agree . But based on the TS knowledge it seems he don’t know REXX ( which is fine ) and hence writing a cobol module as a wrapper to call various REXX modules based on the values in the Db2 table ( Which is fine too ). Either should work. |
The person who claimed he can write the “wrapper” in COBOL must be able to do the same in REXX, from the first attempt. Otherwise I have to doubt if he really knows programming (in any language).
Reading a little bit about REXX would cost much less compared to all headaches when mixing REXX with COBOL... |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
I hope so. He got the info what is needed to get going. |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
IRXEXCOM can be used to communicate between COBOL and Rexx. |
|
Back to top |
|
|
|