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

Invoke a COBOL program from Rexx?


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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: 2358
Location: Israel

PostPosted: Sat Jan 20, 2007 5:12 pm
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
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: 2358
Location: Israel

PostPosted: Wed Jan 31, 2007 10:36 am
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
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
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 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