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

Executing A Shell Script using BPXBATCH


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

New User


Joined: 14 Apr 2008
Posts: 7
Location: chennai

PostPosted: Wed May 06, 2009 5:21 pm
Reply with quote

Hi,

I am trying to execute some unix commend through mainframes, i searched the forums and found out about BPXBATCH, when i tried executing a simple JCL i get this error FSUM1004 Cannot change to directory </u/userid>

Code:
//********   JOB (D3),'UNIX',           
//         MSGCLASS=A,NOTIFY=&SYSUID,REGION=0M
//*                                           
//BPXBATCH EXEC PGM=BPXBATCH                 
//STDOUT   DD   SYSOUT=*                     
//STDERR   DD   SYSOUT=*                     
//STDPARM  DD   *                             
SH echo "This is my first test";     



What is wrong with my script?.... also if i am executing a shell script placed in an UNIX server how do i do it using BPXBATCH? , what parameters do i need, like do i need the IP of the UNIX server to make a connection and then specifiy the directory structure where my script is placed?[/code]
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: Wed May 06, 2009 5:33 pm
Reply with quote

Problem 1: assuming your site uses RACF, contact your site security group and verify that your user id has an OMVS segment with valid program and home entries. (TOP SECRET and ACF/2 have similar functions but I don't use them so don't know their terminology).
Problem 2: contact your site support group and verify that your home directory /u/userid exists or have it created (automount works well).
Problem 3: Unix commands are case-sensitive. You entering SH means you are attempting to execute a program called SH in your home directory -- you are not running a shell command.
Back to top
View user's profile Send private message
depakjan

New User


Joined: 14 Apr 2008
Posts: 7
Location: chennai

PostPosted: Mon May 11, 2009 9:50 am
Reply with quote

Thanks robert, your suggestions were very usefull, now i have some problem now, executing this code gives me this error 'FSUM1004 Cannot change to directory </u/userid>'

Code:
//NBK6CSTA   JOB (NDW3),'UNIX',               
//         MSGCLASS=A,NOTIFY=&SYSUID,REGION=0M
//*                                           
//JS0010 EXEC PGM=BPXBATCH                     
//*                                           
//STDIN     DD SYSOUT=*                       
//STDOUT    DD SYSOUT=*                       
//STDPARM   DD *                               
sh echo mkdir ded


so i chceked whether my directory is present with this code

Code:
//NBK6CSTA   JOB (NDW3),'UNIX',               
//         MSGCLASS=A,NOTIFY=&SYSUID,REGION=0M
//*                                           
//JS0010 EXEC PGM=BPXBATCH                   
//*                                           
//STDIN     DD SYSOUT=*                       
//STDOUT    DD SYSOUT=*                       
//STDPARM   DD *                             
sh echo $HOME       


the output returns /u/userid .. so my home directory is present.. then why am i getting this error...
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: Mon May 11, 2009 4:52 pm
Reply with quote

Try
Code:
sh echo mkdir /u/userid/ded
Batch jobs do not inherit your environment even when executing under your TSO user id, so you have to provide the full path name.
Back to top
View user's profile Send private message
eddychanst

New User


Joined: 04 Jan 2008
Posts: 1
Location: Ontario

PostPosted: Wed Apr 21, 2010 11:51 pm
Reply with quote

use PGM=BPXBATCH,PARM='sh echo $HOME'
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 22, 2010 12:19 am
Reply with quote

eddychanst, you're only 3 weeks shy of replying to an issue inactive for a year.

Also, PARM= and //STDPARM work the same for BPXBATCH.
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 executing XCTL command in COBOL witho... CICS 10
No new posts Receiving RC 5 when executing REXX pr... CLIST & REXX 3
No new posts Issues with executing a REXX MACRO th... TSO/ISPF 4
No new posts Get name of Subsystem routine is exec... All Other Mainframe Topics 2
This topic is locked: you cannot edit posts or make replies. Control-m JOB executing even when the... Compuware & Other Tools 6
Search our Forums:

Back to Top