Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
BPXBATCH access problem

Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: BPXBATCH access problem
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    Post subject: Reply to: BPXBATCH access problem [SOLVED]
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: 8551
Location: Dubuque, Iowa, USA

PostPosted: Mon May 06, 2013 6:26 pm    Post subject:
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    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 Problem getting record length of a re... amitc23 COBOL Programming 2 Thu Jul 02, 2020 10:52 pm
No new posts Problem while trying to manipulate re... amitc23 DFSORT/ICETOOL 3 Tue Jun 30, 2020 1:19 pm
No new posts TSO IOF problem josephineyeow TSO/ISPF 5 Fri Mar 27, 2020 10:18 pm
No new posts Need help with this dfsort problem kushkush DFSORT/ICETOOL 7 Sun Feb 02, 2020 6:34 pm
No new posts Having problem passing a variable to ... markzasz JCL & VSAM 12 Thu Jul 11, 2019 5:31 pm

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