MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Invoke REXX from COBOL
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Jul 08, 2004 7:22 am    Post subject: Invoke REXX from COBOL Reply with quote

Hi,

Can someone provide me with a sample COBOL program to Invoke a REXX routine. (Just for example, lets assume my REXX just has a SAY 'Hi' COMMAND).

I tried to search for previous posts but couldn't find what I wanted .

Thanks,
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu Jul 08, 2004 7:45 am    Post subject: Reply with quote

Phantom,

I don't think you can a REXX exec from batch COBOL. Why not compile the REXX exec and use the regular call statement.

Check this manual for compiling a rexx exec.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/EAGUA03/CCONTENTS?DT=19940906172949

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Thu Jul 08, 2004 7:52 am    Post subject: Reply with quote

OTOH, if you want ISPF services to be used, then you may want to look-up ISPLINK.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Jul 08, 2004 8:00 am    Post subject: Reply with quote

Kolusu,

Unfortunately our shop does not have the REXX compiler. Is it not possible to call REXX from COBOL at all?

I am not going to look for a ONLINE OUTPUT from REXX. Assume I have a REXX that does something in BATCH mode. Can this REXX be called by a COBOL program ?

Please guide me.
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Jul 08, 2004 8:05 am    Post subject: Reply with quote

Cogito,

I don't have ISPF calls in my REXX.

Thanks,
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Thu Jul 08, 2004 8:11 am    Post subject: Reply with quote

Hmm. I was just guessing; because, I have not heard of such situations before.

Maybe, you can have the COBOL program in one step followed by the REXX program in the other step ?
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Jul 08, 2004 8:41 am    Post subject: Reply with quote

Cogito, This is mainly for privacy.

REXX will create a file dynamically and will call another program internally. The contents of the file should not be viewable to others.

If I call REXX in a separate step, the rexx source code could be traced easily and the contents of the file could be determined, but If I call REXX via COBOL program, then no one can know what REXX is being invoked since, all we have is the COBOL load module in the jcl.

Everyone should be able to submit the job but the contents of the file should be hidden.

Please guide me,
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Thu Jul 08, 2004 8:52 am    Post subject: Reply with quote

Quote:
REXX will create a file dynamically...

Why not a temporary dataset?

Quote:
The contents of the file should not be viewable to others.

Why not have a HLQ with proper RACF restrictions applied? Or, encrypt it using IDCAMS REPRPO.

Quote:
...since, all we have is the COBOL load module in the jcl.
Not really. The AMBLIST utility will tell what CSECTs are available in the load module. Therefore, it is possible to find out, if REXX was used.

What is the purpose of creating the file that no-one will be able to view? Is it used anywhere else? If not, then you can load it to a DB2 table which is encrypted. This can be done easily by applying proper EDITPROC exits.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu Jul 08, 2004 8:59 am    Post subject: Reply with quote

Phantom,

Quote:

REXX will create a file dynamically and will call another program internally. The contents of the file should not be viewable to others. Everyone should be able to submit the job but the contents of the file should be hidden.


I am not sure what you mean viewable? Are you encrypting the data? or you just create the dataset with a different name for every run of the program?

Quote:

but If I call REXX via COBOL program, then no one can know what REXX is being invoked since, all we have is the COBOL load module in the jcl.


hmm are you saying that no one can look at the cobol source?

btw if your sole intention is to dynamically create a file, then it is possible in COBOL itself with BPXWDYN and the JCL will not have file listed

Let me know if you are interested to a have an example program which dynamically allocates a file.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Jul 08, 2004 9:22 am    Post subject: Reply with quote

Kolusu,

This is really interesting. Please provide me some info regarding BPXWDYN. Yup, as you said the rexx routine will create a dataset with different name everytime.

Also, could you please provide me with some info on calling rexx via cobol (Just for learning purpose).

Thanks a ton.
Phantom
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu Jul 08, 2004 9:36 am    Post subject: Reply with quote

Phantom,

Here is the documentation of BPXWDYN: Text Interface to Dynamic Allocation and Dynamic Output

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Jul 08, 2004 9:36 am    Post subject: Reply with quote

Kolusu,

Quote:

hmm are you saying that no one can look at the cobol source?


Is there a way to get back the cobol source code from the load module ? B'cas once compiled I can even save the source into a text file (out of the mainframe) and delete the code from the mainframe system (for security).

Thanks,
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu Jul 08, 2004 9:54 am    Post subject: Reply with quote

Phantom,

Quote:

Is there a way to get back the cobol source code from the load module ?


Well there are third-party tools which can recover the source for you. check these

http://www.source-recovery.com/

http://www.coboltools.com/Source-intro.htm


And if you are an expert with assembler , then you can decode the load module and generate the assembler instructions. Now with these assembler instructions , try to generate the equivalent cobol instructions. Not an impossible task, but a difficult one.

Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Jul 08, 2004 10:17 am    Post subject: Reply with quote

Wow, thatz great Kolusu. If we can get back the source code back from load module, then we will miss the security completely. Is there any secured way for the problem ?

Thanks a lot....Unfortunately our shop has a firewall which doesnot allow us to browse FTP sites....(unable to browse the BPXWDYN site...)

I'm trying to search for this over the net. Meanwhile if you have some other HTTP sites please let me know.

Thanks a lot.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu Jul 08, 2004 10:30 am    Post subject: Reply with quote

Phantom,

If your shop has QuickRef (QW) then you can simply type
Code:

QW BPXWDYN


Then you can use QPRINT to print the entire text. Search this forum for running QW in batch.

If your shop does not have Quickref , then I am opening another topic with the documentation.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group