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

Executing Shell Script from Mainframe


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
deybumba_2k

New User


Joined: 09 Jan 2006
Posts: 17

PostPosted: Thu Apr 08, 2010 11:46 am
Reply with quote

Hello All,

I have a requirement of executing a Unix Shell Script in an Unix environment from Mainframe. So let's say the Mainframe will submit a job which will kick off a shell script in an Unix server.

Can this be done?

Thanks,
Subha
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Thu Apr 08, 2010 3:03 pm
Reply with quote

TWS scheduling tool on z/OS can be set up to communicate with a TWS agent on a Unix server, and start shell scripts as a TWS operation.

That's one way to do it. You should talk to your production service planners to learn if it is a possibility on your installation.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Apr 08, 2010 3:06 pm
Reply with quote

What's the relationship between the two? Is this shell script on a z/OS Unix Systems Services (USS) partition that can be directly accessed? If not, does your job scheduling system handle batch processing across the entire enterprise? If not, do both systems support the use of the Unix orexec/rexec command? If not then what do you have that connects these two together somehow?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Apr 08, 2010 4:51 pm
Reply with quote

Search for BPXBATCH :

publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.ibm.zos.r9.bpxa400/xbat.htm
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Apr 08, 2010 5:01 pm
Reply with quote

Quote:
I have a requirement of executing a Unix Shell Script in an Unix environment from Mainframe. So let's say the Mainframe will submit a job which will kick off a shell script in an Unix server.

Can this be done?
Yes -- assuming that your site support group has set up the appropriate pieces of TCP/IP. Find the Communications Server bookshelf and do a find for REXEC.
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Thu Apr 08, 2010 5:29 pm
Reply with quote

PeterHolland wrote:
Search for BPXBATCH :

publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.ibm.zos.r9.bpxa400/xbat.htm

This applies only to UNIX environments on a z/Series mainframe?

The OP didn't specify what kind of server would host the targeted UNIX environment?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Apr 08, 2010 5:35 pm
Reply with quote

Quote:

TWS scheduling tool on z/OS can be set up to communicate with a TWS agent on a Unix server, and start shell scripts as a TWS operation

Quote:

The OP didn't specify what kind of server would host the targeted UNIX environment?


And?
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Thu Apr 08, 2010 6:08 pm
Reply with quote

PeterHolland wrote:
Quote:

TWS scheduling tool on z/OS can be set up to communicate with a TWS agent on a Unix server, and start shell scripts as a TWS operation

Quote:

The OP didn't specify what kind of server would host the targeted UNIX environment?


And?

Here is more information on TWS scheduling operations on remote UNIX systems.

I have also found an IBM online presentation on agentless TWS scheduling

My site uses the TWS agent method to automatically sequence and schedule operations on s/Series servers running UNIX from a z/OS TWS server.

You should still talk to your site support people to see if this could be a solution to your requirements.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Fri Apr 09, 2010 1:14 am
Reply with quote

I *think* REXEC sends info, including passwords, in clear text. A better option would be SSH.
Back to top
View user's profile Send private message
deybumba_2k

New User


Joined: 09 Jan 2006
Posts: 17

PostPosted: Fri Apr 09, 2010 11:35 am
Reply with quote

There is a relationship between the 2 system and they support REXEC. I also saw that REXEC can execute a shell script in a remote Unix server from Mainframe.

Can anybody provide any example of REXEC?

Thanks,
Subha
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Apr 09, 2010 4:55 pm
Reply with quote

The simplest example I have of REXEC is:
Code:
//REXEC    EXEC PGM=REXEC,
//  PARM=('/jcap2 /jcap2/mse/DaveTemp/MerlinToProcess')
//SYSTSPRT  DD SYSOUT=*
//NETRC    DD   *
MACHINE jcap2 LOGIN mgr PASSWORD xxxxxxx
/*
//SYSPRINT  DD SYSOUT=*
//
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
No new posts Mainframe Programmer with CICS Skill... Mainframe Jobs 0
No new posts How to Reformat a file using File Man... All Other Mainframe Topics 14
No new posts executing XCTL command in COBOL witho... CICS 10
No new posts NDM getting stuck - mainframe/JCL All Other Mainframe Topics 13
Search our Forums:

Back to Top