Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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
tuxama

New User


Joined: 25 Jan 2007
Posts: 32
Location: france

PostPosted: Fri Apr 26, 2013 12:35 pm    Post subject: BPXBATCH access problem
Reply with quote

Hello,

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

Code:

//SHELLCMD EXEC PGM=BPXBATCH,REGION=8M,             
//            PARM='SH /bin/echo hello world!'     
//SYSTSPRT DD SYSOUT=*                             
//SYSPRINT DD SYSOUT=*                             
//SYSOUT   DD SYSOUT=*                             
//STDOUT   DD PATH='/tmp/&SYSUID..out',             
//            PATHOPTS=(OWRONLY,OCREAT,OTRUNC),     
//            PATHMODE=SIRWXU                       
//STDERR   DD PATH='/tmp/&SYSUID..err',             
//            PATHOPTS=(OWRONLY,OCREAT,OTRUNC),     
//            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'                       
//STDOUTL  DD SYSOUT=*,DCB=(RECFM=VB,LRECL=133,BLKSIZE=137) 
//STDERRL  DD SYSOUT=*,DCB=(RECFM=VB,LRECL=133,BLKSIZE=137) 
//SYSTSIN  DD *                                             
 OCOPY INDD(HFSOUT) OUTDD(STDOUTL) TEXT                     
 OCOPY INDD(HFSERR) OUTDD(STDERRL) TEXT                     
/*                                                           


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

Code:

STEPNAME PROCSTEP    RC
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 :
Code:

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


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

tuxama

New User


Joined: 25 Jan 2007
Posts: 32
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: 7936
Location: Bellevue, IA

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:
Quote:
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 SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts IMS DC screen Access sivasaras IMS DB/DC 3 Fri Nov 18, 2016 6:38 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us