Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Invoke a COBOL program from Rexx?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Sasi Kiran Patha
Warnings : 2

New User


Joined: 19 Nov 2006
Posts: 73
Location: Hyederabad

PostPosted: Sat Jan 20, 2007 4:31 pm    Post subject: Invoke a COBOL program from Rexx?
Reply with quote

Hi ,

Im new to Rexx and CLIST.
Can a COBOL program execution be invoked using Clist command like "TSO ----"
If Yes can we pass parameters that the program requires and
the store the output of the program in any file.
The COBOL program accesses Db2 tables.

Regards,
Sasi Patha. :-)
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Sat Jan 20, 2007 5:12 pm    Post subject:
Reply with quote

Usually, you invoke DB2 programs using the RUN command, which is actually a subcommand of TSO's DSN command.

You can invoke the DSN command just as you invoke any other TSO command from within REXX (same as ALLOCATE, FREE etc.).

O.
Back to top
View user's profile Send private message
venkatesh.nayak

New User


Joined: 07 Jan 2007
Posts: 3
Location: Bangalore

PostPosted: Wed Jan 31, 2007 10:29 am    Post subject:
Reply with quote

If you want to execute a COBOL+ DB2 progra using REXX then you need to follow th ebelow steps.

1. Code the REXX Program as

PARSE VALUE v1 v2 v3 with r1 r2 r3
ADDRESS ISPEXEC "EDIT DATASET (<JCL member location>) MACRO(abcde)

wher 'abcde' is a clist member which may conatins SUBMIT command and/or change command if you want to change parameters inside the JCL.


2. execute the REXX code using EXEC command


But prerequisite is your JCL should do PC, Compile, LKED & Bind operations.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Jan 31, 2007 10:36 am    Post subject:
Reply with quote

venkatesh.nayak -

Why do you have to use JCL in order to run a program? icon_eek.gif

O.
Back to top
View user's profile Send private message
Sasi Kiran Patha
Warnings : 2

New User


Joined: 19 Nov 2006
Posts: 73
Location: Hyederabad

PostPosted: Wed Jan 31, 2007 10:50 am    Post subject: Re: Invoke a program from Rexx?
Reply with quote

Hi,

I did not mention i need JCL. I wanted to execute a program which
can be invoked from REXX. I did not know how to proceed.

This idea could be useful for testing in Test(development) regions.
especially to prepare a test case. If we can pass a few input parameters
the output will be helpful in preparing the test case parameters.
its going for automation rather that going through all the Db2 tables
and then determining the test case.

Regards,
Sasi Patha.
Back to top
View user's profile Send private message
venkatesh.nayak

New User


Joined: 07 Jan 2007
Posts: 3
Location: Bangalore

PostPosted: Wed Jan 31, 2007 11:39 am    Post subject: Re: Invoke a program from Rexx?
Reply with quote

Hi

Please do let you clarify one thing to me

1. Do you want to execute a COBOL + DB2 program which inturn called/invoked by REXX program directly?
- I have no idea

2. Do you want to execute the JCL which inturn execute the COBOL + DB2 program?
- if so we can do by this way.

/* Rexx */

"concatc sysproc USERID.MACRO.CLIST TOP"

PARSE VALUE v1 v2 v3 with r1 r2 r3
ADDRESS ISPEXEC "EDIT DATASET ('userid.program.cobol(coboldb2)' ) MACRO(sumbitjob)
Exit

/* End of Rexx Program */


USERID.MACRO.CLIST (submitjob)

SUB


1. here using PARSE VALUE command you can pass the value to your JCL i.e. passing a few input parameters. v1, v2, v3 are the values that you wish to pass it on to job where as r1 r2 r3 are recieving variable in JCL

2. CLIST member submitjob should have contain "SUB" tso command.

3. After all this, issue EXEC command on command line

Please revert back to me if you have not clear with this replay.

Thanks,
Venkatesh
919448450590
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 REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us