setting an umask

General discussion on the JZOS batch launcher and toolkit
Post Reply
Richard Tiefenbrunner
Posts: 2
Joined: Mon Jan 02, 2006 8:24 am

setting an umask

Post by Richard Tiefenbrunner »

Does JZOS have an option to set an umask to control the access rights of the files that the started program creates?

With BPXBATCH we called a script doing the following:

#! /bin/sh
umask ...
...
exex java ...

But this obviously does not work with JZOS.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

Thank you for your question. I'm now a little surprised that this has not been asked before, since it seems like a reasonable thing to want to do...

BPXBATCH uses a special environment variable to set UMASK for PARM='PGM ...' (where no login shell is run). JZOS has no such facility, but perhaps it should.

According to the z/OS C++ User's guide, there is an environment variable which can be used called "_EDC_UMASK_DFLT". According to the documentation, this is used to set the default UMASK for a program.

You could try adding the following to your JZOS //STDENV script:

export _EDC_UMASK_DFLT=0022

But I'm guessing that this won't work because it is set too late to affect the "default". The alternative is to set this environment variable using an LE runtime option (which would be established during USS initialization).

For example, using the supplied JZOS stored procedure:

// EXEC PROC=EXJZOSVM,VERSION='14',
// LEPARM='ENVAR(“_EDC_UMASK_DFLT=0022”)',
// JAVACLS='com.dovetail.jzos.sample.HelloWorld

Please let us know if this works for you. I'm sorry that I didn't have time today to try it myself, but I'm hopeful that this will work.

Kirk
Richard Tiefenbrunner
Posts: 2
Joined: Mon Jan 02, 2006 8:24 am

Post by Richard Tiefenbrunner »

Thanx very much.

Setting _EDC_UMASK_DFLT in the //STDENV script works perfectly.

Best regards
Richard
Post Reply