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
 
Any experience with REXX calling a Cobol/DB2 program?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Any experience with REXX calling a Cobol/DB2 program?
Reply with quote

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

Pedro

Senior Member


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

PostPosted: Fri Feb 20, 2009 12:59 am    Post subject: Reply to: Any experience with REXX calling a Cobol/DB2 progr
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    Post subject:
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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Feb 25, 2009 3:13 am    Post subject:
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    Post subject:
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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Feb 26, 2009 4:03 am    Post subject:
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    Post subject:
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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Feb 26, 2009 5:40 am    Post subject:
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    Post subject: Reply to: Any experience with REXX calling a Cobol/DB2 progr
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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Feb 27, 2009 2:06 am    Post subject: Reply to: Any experience with REXX calling a Cobol/DB2 progr
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Looping REXX - unable to interrupt RAVISANKAR07 CLIST & REXX 3 Wed Dec 06, 2017 1:08 pm
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
This topic is locked: you cannot edit posts or make replies. Rexx to Grab ISMF Information. upendrasri All Other Mainframe Topics 16 Sun Nov 26, 2017 12:35 am
No new posts Rexx to send an email without SMTP Se... upendrasri All Other Mainframe Topics 12 Sun Nov 19, 2017 7:59 pm

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