TMPDIR processing

z/OS® UNIX needs write access to /tmp, or another directory that is referenced by the TMPDIR variable, to be able to process certain commands during started task startup. z/OS Explorer uses the following logic to set TMPDIR during started task startup.

During started task startup, z/OS Explorer checks whether TMPDIR is already set (DD STDENV). If so, the started task uses that value. If TMPDIR is not set, the started task will test whether it can use /tmp. If not, the started task will test whether it can use the home directory that is assigned to the started task user ID. If this directory cannot be used either, startup fails.

If you cannot use the home directory, which is the default backup for /tmp, then you have to predefine TMPDIR using DD STDENV, as in the following sample:
Figure 1. RSED: alternate TMPDIR processing
//*
//* RSE DAEMON
//*
//RSED     PROC IVP=,                   * 'IVP' to do an IVP test
//            PORT=,
//            CNFG='/etc/zexpl',
//            HOME='/usr/lpp/IBM/zexpl'
//*
//RSED     EXEC PGM=BPXBATSL,REGION=0M,TIME=NOLIMIT,
// PARM='PGM &HOME./bin/rsed.sh &IVP –C&CNFG –P&PORT'  
//STDOUT   DD SYSOUT=*  
//STDERR   DD SYSOUT=*  
//STDENV   DD PATHOPTS=(ORDONLY),PATH=’&CNFG./rsed.stdenv’ 
//         PEND  
//*
Then create the file (/etc/zexpl/rsed.stdenv in this example) that will hold the TMPDIR definition. You can edit the file with the TSO OEDIT command. The content of this file looks like the following sample:
Figure 2. rsed.stdenv: alternate TMPDIR processing
TMPDIR=/tmp

Make sure the directory TMPDIR points at, for example, /my/tempdir, is available.