View previous topic :: View next topic
|
Author |
Message |
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
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 |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
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 |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
Thank you Robert for your help. i think this will be helpful. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
Although this is new to me...but now i can talk to client with some knowledge. |
|
Back to top |
|
|
|