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

Issuing more than one command via BPXBATCH


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

New User


Joined: 14 Mar 2006
Posts: 8
Location: Liverpool

PostPosted: Thu Jan 15, 2009 5:34 pm
Reply with quote

I am trying to issue more than one command (usually around 4) via a batch job to USS using bpxbatch.

I can issue one command without any problems but the other commands are ignored.

Is it possible?

My JCL is:

Code:
//RUNSHELL EXEC PGM=BPXBATCH
//STDOUT   DD  SYSOUT=*
//STDERR   DD  SYSOUT=*
//STDPARM  DD  DSN=SPYPMM.GZAST.ABI.STDPARM(BPXPARM),DISP=SHR


My STDPARM is:


Code:
SH echo "This is my first test";
SH /u/myuserid;
SH mkdir bpxtest1;
SH cd bpxtest1;
SH echo "End of my test"


I have tried using + instead of ; I have also tried using piping | as a desperate attempt!!!

My OUTPUT is:

Code:

This is my first test
SH: FSUM7351 not found
SH: FSUM7351 not found
SH: FSUM7351 not found
SH: FSUM7351 not found


Any suggestions?
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 Jan 15, 2009 6:30 pm
Reply with quote

If you read the manual on BPXBATCH, you will find that it is designed to run a program or shell script. It is not designed to run as many programs or shell scripts as you want -- just one. Take your commands (not all of which are valid, by the way) and change them to
Code:
echo "This is my first test";
cd /u/myuserid;
mkdir bpxtest1;
cd bpxtest1;
echo "End of my test"
and save these as /u/myuserid/shellscript.sh on your system. Then change SPYPMM.GZAST.ABI.STDPARM(BPXPARM) to say
Code:
sh /u/myuserid/shellscript.sh
run the job and see what the results are.
Back to top
View user's profile Send private message
maddop

New User


Joined: 14 Mar 2006
Posts: 8
Location: Liverpool

PostPosted: Thu Jan 15, 2009 7:10 pm
Reply with quote

Thanks for the reply.

I have read the manual on bpxbatch and understand that it is to used for shell scripts and programs.

I can do that without any issues but I am trying to execute commands that are read via STDPARM PDSE member.

I know it is possible to do since z/OS 1.8... just trying to get the syntax correct.
Back to top
View user's profile Send private message
maddop

New User


Joined: 14 Mar 2006
Posts: 8
Location: Liverpool

PostPosted: Thu Jan 15, 2009 7:37 pm
Reply with quote

I've been able to sort this out... looks like i just stack the commands:

STDPARM member:
Code:

SH echo "start of test";
mkdir test01;
mkdir test01/subdir;
echo "end of test"


Tested successfully... Nothing complicated will be issued, its purely to make life easier for 1st line support staff with little USS knowledge. icon_biggrin.gif
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 Jan 15, 2009 8:20 pm
Reply with quote

Note the semicolon actually means this is one shell command line being executed -- as I stated earlier, BPXBATCH only runs one command. You can string things together via ; but it's still only one command line as seen by Unix.
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 RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts LTJ command CA Products 4
No new posts Query on edit primary command CLIST & REXX 5
Search our Forums:

Back to Top