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

Calling COBOL through REXX


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

New User


Joined: 25 Nov 2009
Posts: 10
Location: India

PostPosted: Wed May 23, 2012 4:11 pm
Reply with quote

Could you please help me how a COBOL program can be called through a REXX program. And how the libraries can be specified in the JCls.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed May 23, 2012 4:32 pm
Reply with quote

Well, in any type of address space your exec may be running in, the Address LINKMVS command will always work.

If your exec is running in a TSO address space then you can use the same commands as you would in TSO. If ISPF services are available, then the ISPF SELECT PGM command is also an option.

Harry_harran wrote:
And how the libraries can be specified in the JCls.


I have no idea what this means.
Back to top
View user's profile Send private message
Harry_harran

New User


Joined: 25 Nov 2009
Posts: 10
Location: India

PostPosted: Wed May 23, 2012 5:09 pm
Reply with quote

Thanks superk.

I get it. Now, if suppose we have to pass some variable while after running the exec in TSO.
For expample, for getting the ip address for a specific address we use
TSO PING
and then we will give the web address inorder to get the IP address of the website.

So how to make it ask for the input values and how to pass the values to the COBOL program.

For my next question,
And how the libraries can be specified in the JCls.

If we want to execute a REXX program in batch and if that Rexx program call another COBOL program, then how it has to be coded in JCL.

Thanks,
Harry.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed May 23, 2012 5:20 pm
Reply with quote

hmmmmm
I wonder to which level in remedial z/OS architecture, elements and features
one must go
to answer the question posed by the TS.

funny, it seems that many think that rexx is a way of doing something on the mainframe
without knowing actually what is going on.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed May 23, 2012 5:37 pm
Reply with quote

i have thought about my previous post,
and have decided to make a correction:

FROM THIS:

I wonder to which level in remedial z/OS architecture, elements and features

TO THIS:

I wonder to what depths of remedial z/OS architecture, elements and features must we plunge
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed May 23, 2012 7:05 pm
Reply with quote

Harry_harran wrote:
If we want to execute a REXX program in batch and if that Rexx program call another COBOL program, then how it has to be coded in JCL.

If you were to run the COBOL program as a "main" program in a job, you would certainly have to code a few DD cards for input or output files.
Now you have three possibilities:
  1. Preallocate the files by adding the same DD cards to the REXX job.
  2. Allocate the files in the REXX program using the TSO ALLOCATE command.
  3. Use a mix of the 2 previous options.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed May 23, 2012 7:17 pm
Reply with quote

It can be done in several ways, as Kevin indicates, from a REXX exec running under TSO, you can issue the TSO CALL command. AFAIK, it has a limitation that you can only pass a single halfword prefixed string that can't be modified.

In a REXX exec use ADDRESS LINK or ADDRESS ATTACH. OR in REXX exec use ADDRESS LINKMVS or ADDRESS ATTCHMVS.

A called compiled program can use the IKJCT441 service to access and update the values of REXX variables.

And here are some existing topics:

ibmmainframes.com/about32320.html
ibmmainframes.com/about42923.html
ibmmainframes.com/about52076.html
ibmmainframes.com/about38247.html


PS.: Please learn to search.
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Replace each space in cobol string wi... COBOL Programming 3
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