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
 
Calling COBOL through REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Calling COBOL through REXX
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

Moderator Team Head


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

PostPosted: Wed May 23, 2012 4:32 pm    Post subject: Reply to: Calling COBOL through REXX
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    Post subject:
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: 6970
Location: porcelain throne

PostPosted: Wed May 23, 2012 5:20 pm    Post subject:
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: 6970
Location: porcelain throne

PostPosted: Wed May 23, 2012 5:37 pm    Post subject:
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: 1250
Location: Israel

PostPosted: Wed May 23, 2012 7:05 pm    Post subject:
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

Senior Member


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

PostPosted: Wed May 23, 2012 7:17 pm    Post subject:
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:

http://ibmmainframes.com/about32320.html
http://ibmmainframes.com/about42923.html
http://ibmmainframes.com/about52076.html
http://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    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