Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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
depakjan

New User


Joined: 14 Apr 2008
Posts: 7
Location: chennai

PostPosted: Wed May 06, 2009 5:21 pm    Post subject: Executing A Shell Script using BPXBATCH
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: 8201
Location: Dubuque, Iowa, USA

PostPosted: Wed May 06, 2009 5:33 pm    Post subject:
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    Post subject:
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: 8201
Location: Dubuque, Iowa, USA

PostPosted: Mon May 11, 2009 4:52 pm    Post subject:
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    Post subject:
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: 8201
Location: Dubuque, Iowa, USA

PostPosted: Thu Apr 22, 2010 12:19 am    Post subject:
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    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 Iterative use of a REXX script causin... bryonyh CLIST & REXX 4 Fri Jul 28, 2017 12:52 pm
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

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us