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

BPXBATCH access problem

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

New User

Joined: 25 Jan 2007
Posts: 35
Location: france

PostPosted: Fri Apr 26, 2013 12:35 pm
Reply with quote


I try for the first time to access USS in batch via BPXBATCH.
I start with a simple hello world.


//            PARM='SH /bin/echo hello world!'     
//SYSTSPRT DD SYSOUT=*                             
//SYSPRINT DD SYSOUT=*                             
//SYSOUT   DD SYSOUT=*                             
//STDOUT   DD PATH='/tmp/&SYSUID..out',             
//            PATHMODE=SIRWXU                       
//STDERR   DD PATH='/tmp/&SYSUID..err',             
//            PATHMODE=SIRWXU                       
//COPYOPUT EXEC PGM=IKJEFT01,DYNAMNBR=300                   
//SYSPRINT DD SYSOUT=*                                       
//SYSTSPRT DD SYSOUT=*                                       
//HFSOUT   DD PATH='/tmp/&SYSUID..out'                       
//HFSERR   DD PATH='/tmp/&SYSUID..err'                       
//SYSTSIN  DD *                                             

In my JCL I write two steps, the first call to BPXBATCH with stdout and sterr defined. The second step a copy to recover dataset stdout and stderr files.

First observation in stepname table : The result brings up 4 steps


SHELLCMD             00
*OMVSEX              00
*OMVSEX              01
COPYOPUT             00

*OMVSEX were automatically generated and I do not know what they do !

Second observation the return code 01
In message and code documentation it appears that it is the return code of the executed command,I imagine here echo

Is this a problem with my way of coding the JCL ?
Is this a problem specific to the site of my client (USS implementation/installation/Customization) ?

However, in a Rexx I access USS, with no error, like this :

If stdin.0> 0 Then Do
    cmd = "sort-r-k1-k2"
    bpxwunix call cmd, stdin., stdout., stderr.

Thanks for you help.
Back to top
View user's profile Send private message

New User

Joined: 25 Jan 2007
Posts: 35
Location: france

PostPosted: Mon May 06, 2013 2:24 pm
Reply with quote

It's RACF problem :

    An OMVS segment must be added to USER ;
    an OMVS segment must be added to the DEFAULT-GROUP (attached to the USER)
Back to top
View user's profile Send private message
Robert Sample

Global Moderator

Joined: 06 Jun 2008
Posts: 8570
Location: Dubuque, Iowa, USA

PostPosted: Mon May 06, 2013 6:26 pm
Reply with quote

From the z/OS Unix System Services User's Guide manual on BPXBATCH:
BPXBATCH has logic in it to detect when it is running from a batch job. By default, BPXBATCH sets up the stdin, stdout, and stderr standard streams (files) and then calls the exec callable service to run the requested program. The exec service ends the current job step and creates a new job step to run the target program. Therefore, the target program does not run in the same job step as the BPXBATCH program; it runs in the new job step created by the exec service. In order for BPXBATCH to use the exec service to run the target program, all of the following must be true:

BPXBATCH is the only program running on the job step task level.
The _BPX_BATCH_SPAWN=YES environment variable is not specified.
The STDOUT and STDERR ddnames are not allocated as MVS data sets.

If any of the these conditions is not true, then the target program runs either in the same job step as the BPXBATCH program or in a WLM initiator in the OMVS subsys category. The determination of where to run the target program depends on the environment variable settings specified in the STDENV file and on the attributes of the target program.
In other words, the extra OMVSEX is normal and expected (depending upon your site parameters).

Your JCL works just fine on my site and produces the expected output in STDOUT. Hence, the problem is specific to your site. While it could be RACF, I rather suspect not as you'd get a different error (and no OMVSEX steps) if that were the case. To confirm the lack of RACF problem, try going to ISPF option 3.17 and browse the /tmp/ directory to see if your output and error files are there. If you can see the directory and your files are there, you do not have a RACF problem. If your files are not in the directory, you probably have a permissions problem that your site support group needs to work on (but again, probably not a RACF issue).

STDERR should have the output of your command, if STDOUT does not. You did not post what STDERR printed, thus we on this forum cannot provide much more help.
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 problem in select max when executing ... IMS DB/DC 6
No new posts Sysncsort - Justification problem SYNCSORT 6
No new posts Using REXX to access SDSF; What am I ... CLIST & REXX 38
No new posts Problem getting record length of a re... COBOL Programming 2
No new posts Problem while trying to manipulate re... DFSORT/ICETOOL 3
Search our Forums:

Back to Top