Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Executing A Shell Script using BPXBATCH

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Thu Jun 25, 2009 1:53 pm    Post subject: Executing A Shell Script using BPXBATCH
Reply with quote

Hi all,

i need to execute a shell script from Mainfram also i need to pass some parameters. can anyone tell how to do using BPXBATCH.

will the below code work...the first parm is the script path i need to trigger and the next line is parameter i need to pass for the above script.

Code:

//STDPARM  DD   *                             
SH script path
REVELAR,export_tdxwrvi1.fxp,test_tdpwrvia.txt,Y
/*


i check all the documents and also searched in the forum. But i did not get the help for my query.

thanks,
Back to top
View user's profile Send private message

arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Thu Jun 25, 2009 1:55 pm    Post subject:
Reply with quote

I checked the below paths:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/bpxza460/11.2?DT=20050615135744

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/BPXZA590/HDRBPXBATR?DT=20080605071233&SCROLLTOP=HDRBPXBATR
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7989
Location: Bellevue, IA

PostPosted: Thu Jun 25, 2009 4:54 pm    Post subject:
Reply with quote

Put a plus sign at the end of your first line. You will need to break the command at a space for Unix to process it correctly. If you cannot do so, create a file with LRECL long enough to handle your command, store the command in it, and point STDPARM to this file. I've tested STDPARM with DCB of VB, 27994, 27998 with no problems.
Back to top
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Thu Jun 25, 2009 5:02 pm    Post subject:
Reply with quote

Hi Robert,

Quote:

You will need to break the command at a space for Unix to process it correctly

you mean to replace comma "," with a space.
Back to top
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Thu Jun 25, 2009 5:08 pm    Post subject:
Reply with quote

is the below code correct.

Code:


//STDPARM  DD   *                             
SH script path  +
REVELAR export_tdxwrvi1.fxp test_tdpwrvia.txt Y
/*



Aslo, can we supply unxi path to trigger the script. Actually the script is in the UNIX box.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7989
Location: Bellevue, IA

PostPosted: Thu Jun 25, 2009 5:23 pm    Post subject:
Reply with quote

Yeah, assuming the script path includes the script name (which is not REVELAR), your syntax is correct. If the script name is REVELAR then you cannot put a space after the path before the script you're trying to execute.

When you say the script is in the UNIX box, do you mean the script is on another server entirely, or do you mean the script is stored in a z/OS Unix System Services file somewhere? If the latter then your command will execute fine. If the former, you will need to forget BPXBATCH entirely and use REXEC to remotely execute the UNIX script on the UNIX box.

BPXBATCH only executes scripts on the z/OS mainframe somewhere in a Unix System Services file.
Back to top
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Thu Jun 25, 2009 5:39 pm    Post subject:
Reply with quote

it is on different sever. How to use REXEC in JCL

Code:

rexec -d -l user-id -p password -s port remote-hostname command


Can you please provide me the JCL with REXEC.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7989
Location: Bellevue, IA

PostPosted: Thu Jun 25, 2009 5:51 pm    Post subject:
Reply with quote

I have used this code to access a UNIX server before:
Code:
//FTP01    EXEC PGM=REXEC,
//  PARM='xxx-hry2'
//PROFILE  DD   DISP=SHR,DSN=<TCP/IP profile data>
//NETRC    DD   *
MACHINE xxx-hry2 LOGIN userid PASSWORD userpass
/*
//SYSPRINT  DD SYSOUT=*
//SYSTSPRT  DD SYSOUT=*
//SYSTSIN   DD *
'/app/gen/bin/jqsubmit -jrpt payrpt PR296TST'
/*
where the PARM is the server name, the NETRC contains the server sign on data, and the //SYSTSIN DD * input is the command to execute on the server. IIRC, the quotes around the command are required to ensure the entire string is passed to the remote server; otherwise the first space stops the command. The //PROFILE may not be needed, depending on how your site is set up.

I think there is some set up required on TCP/IP on your mainframe, and the remote server must be listening for REXEC commands on port 512 IIRC. The service is RXSERVE according to my notes. You should verify access through your site support group if you run into any problems along the way.
Back to top
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Thu Jun 25, 2009 5:57 pm    Post subject:
Reply with quote

Thank you Robert for your help. i think this will be helpful.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7989
Location: Bellevue, IA

PostPosted: Thu Jun 25, 2009 6:05 pm    Post subject:
Reply with quote

I hope so, Arvind -- I do know the posted JCL worked to access a UNIX server here, so with appropriate tweaking it should do the task for you.
Back to top
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Thu Jun 25, 2009 6:21 pm    Post subject:
Reply with quote

Although this is new to me...but now i can talk to client with some knowledge.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Viewing executing process in NDM .. q... Debb.Brant IBM Tools 0 Wed Dec 14, 2016 10:55 pm
No new posts Easytrieve - Report writing - Only 1 ... Abhi Nature CA Products 2 Wed Sep 14, 2016 11:40 am
This topic is locked: you cannot edit posts or make replies. Executing JCL specific steps at speci... Shruti Takkar JCL & VSAM 6 Mon Feb 22, 2016 12:39 pm
No new posts Error executing command TSO OMVS - Cr... sirbaros TSO/ISPF 5 Mon Oct 26, 2015 8:26 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us