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

Any experience with REXX calling a Cobol/DB2 program?


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
David Joyce

New User


Joined: 08 Aug 2008
Posts: 17
Location: Boulder Colorado

PostPosted: Thu Feb 19, 2009 11:51 pm
Reply with quote

Any input would be appreciated. Thanks.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Fri Feb 20, 2009 12:59 am
Reply with quote

How do you invoke your COBOL program without rexx?
Back to top
View user's profile Send private message
David Joyce

New User


Joined: 08 Aug 2008
Posts: 17
Location: Boulder Colorado

PostPosted: Wed Feb 25, 2009 2:42 am
Reply with quote

Here is a CLIST example executing Cobol/DB2:
DSN SYSTEM(DSN1)
DATA
RUN PROGRAM(TESTDSJG) PLAN(TESTPLAN) LIB('DB2DBA.DBA.BTCHLOAD')
END
ENDDATA

Here is a sample from JCL:
DSN SYSTEM(DSN1)
RUN PROGRAM(TESTDSJG) PLAN(TESTPLAN) LIB('DB2DBA.DBA.BTCHLOAD')
END

I just can't seem to figure out how to call this Cobol/DB2 program from a Rexx exec.
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 25, 2009 3:13 am
Reply with quote

Hello,

Is the rexx to wait on the cobol program to complete? Is the rexx to have interaction with the cobol program?

If there is no interaction between the rexx code and the cobol program, you might just submit the cobol program to run in batch?

If the cobol program must run as part of the online session (Clarification please), you might invoke a little clist (from rexx) to execute the cobol program (surely less than elegant<g>).
Back to top
View user's profile Send private message
David Joyce

New User


Joined: 08 Aug 2008
Posts: 17
Location: Boulder Colorado

PostPosted: Wed Feb 25, 2009 8:33 pm
Reply with quote

Dick,
Yes I need the Rexx to wait until the Cobol program completes. Is that possible? If I invoke a clist that executes the cobol program do I have the ability to pass information between the rexx, clist and cobol program? 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: Thu Feb 26, 2009 4:03 am
Reply with quote

Hello,

Quote:
Yes I need the Rexx to wait until the Cobol program completes. Is that possible?
Yes - actually, unless some provision was made to do otherwise, the rexx would wait until control was returned to the rexx.

You can pass info from the rexx to the clist. . .

Currently, how do you pass a parm from a clist to a cobol/db2 program?
Back to top
View user's profile Send private message
David Joyce

New User


Joined: 08 Aug 2008
Posts: 17
Location: Boulder Colorado

PostPosted: Thu Feb 26, 2009 4:56 am
Reply with quote

Dick,
I need to be able to pass parms from a rexx exec to a clist to a cobol/db2 program and back.

When I call the clist from rexx I use this command:
ADDRESS TSO "EXEC 'DB2DBA.DBA.REXX.CLIST(DB2REXXE)' CLIST"

I think I can add what I want to pass on the end like this:
ADDRESS TSO "EXEC 'DB2DBA.DBA.REXX.CLIST(DB2REXXE)' CLIST" 'parm1 parm2'

Then I will execute the cobol/db2 program from the clist like this:

PROC 2 parm1 parm2
DSN SYSTEM(DSN1)
DATA
RUN PROGRAM(TESTDSJB) PLAN(TESTPLAN) LIB ('DB2DBA.DBA.BTCHLOAD') PARMS ('/parm1 parm2')
END
ENDDATA
EXIT

I will be testing my theory tomorrow. 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: Thu Feb 26, 2009 5:40 am
Reply with quote

Hi David

Quote:
and back
This may be more tricky. . .
Code:
RUN PROGRAM(TESTDSJB) PLAN(TESTPLAN) LIB ('DB2DBA.DBA.BTCHLOAD') PARMS ('/parm1 parm2')
is "one-way" is it not?

What "service" does the called program provide?
Back to top
View user's profile Send private message
David Joyce

New User


Joined: 08 Aug 2008
Posts: 17
Location: Boulder Colorado

PostPosted: Fri Feb 27, 2009 12:43 am
Reply with quote

Dick,
Upon further investigation I realized I do not need to pass any information back. I have tested this process Rexx calls Clist call Cobol/DB2, I pass information from the Rexx to the Clist to the Cobol/Db2 and everything is working. Thanks for your help.
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: Fri Feb 27, 2009 2:06 am
Reply with quote

Hi David,

Good to hear it is working - thanks for the update icon_smile.gif

d
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts Using API Gateway from CICS program CICS 0
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
Search our Forums:

Back to Top