Using COZBATCH for Netview Unix Server

Discussion of the COZBATCH utility for z/OS
Post Reply
jacobsm
Posts: 37
Joined: Thu Apr 23, 2009 9:18 am
Location: Tampa, Florida

Using COZBATCH for Netview Unix Server

Post by jacobsm »

I tried to use COZBATCH as the kickoff process for the Netview Unix System Server function, and it didn't work.

//COZBATCH EXEC COZBATCH,PARM='/ _BPX_SHAREAS=YES'
//STDIN DD *
/usr/lpp/netview/v6r2/bin/cnmeunix
//STDENV DD *
PATH=/bin:/usr/lpp/netview/v6r2/bin
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*

The server wouldn't recognize/use the PATH statement in STDENV, I had to revert back to using BPXPATCH as per IBM's sample JCL.

// EXEC PGM=BPXBATCH,REGION=0M,TIME=NOLIMIT,
// PARM='PGM /usr/lpp/netview/v6r2/bin/cnmeunix'
//*
//STDOUT DD PATH='/tmp/netview/v6r2/cnmeunix.stdout',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
// PATHMODE=SIRWXU
//*
//STDERR DD PATH='/tmp/netview/v6r2/cnmeunix.stderr',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
// PATHMODE=SIRWXU
//*
//STDENV DD *
PATH=/bin:/usr/lpp/netview/v6r2/bin
/*

I opened up an SR with IBM support and among their comments they said this;

it may be the case that cnmeunix is being run as a shell (SH) script, rather than "program" (PGM) in BPXBATCH. If so, this could cause the PATH information defined in STDENV to be overridden by PATH information coded in shell profile scripts (like /etc/profile and .profile for the user ID associated with the NetView UNIX server job/started task).

I was curious on your take on the problem with COZBATCH.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: Using COZBATCH for Netview Unix Server

Post by dovetail »

In your COZBATCH JCL, you are running a the default login shell for the userid and then under that shell you are running the cnmeunix program.
You are setting _BPX_SHAREAS=YES prior to invoking the shell (the default for COZBATCH is _BPX_SHAREAS=MUST, but this is usually changed by the shell's login profile )

In the BPXBATCH example, you are just invoking the program, without a shell.

I would think that the most likely problem is that the environment prior to running the cnmeunix program is not the same:
- the /etc/profile or ~/.profile could be setting the PATH, _BPX_SHAREAS=NO, or other environment variables that are different
from what BPXBATCH is setting up (which is very little)

Try this and see what you get:

//COZBATCH EXEC COZBATCH
//STDIN DD *
export _BPX_SHAREAS=YES
export PATH=/bin:/usr/lpp/netview/v6r2/bin
env #debug
/usr/lpp/netview/v6r2/bin/cnmeunix
//
jacobsm
Posts: 37
Joined: Thu Apr 23, 2009 9:18 am
Location: Tampa, Florida

Re: Using COZBATCH for Netview Unix Server

Post by jacobsm »

Perfect. That suggestion worked. Thank you.
Post Reply