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. RSE API uses the following logic to set TMPDIR during started task startup.

During started task startup, RSE API 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. RSE API: alternate TMPDIR processing
//*
//* RSE API
//*
//RSEAPI   PROC HOME='/usr/lpp/IBM/rseapi',
//            APICFG='/etc/zexpl',
//            RSECFG='',
//            SRVNUM='1',
//            SECURE='true'
//*
//         EXPORT SYMLIST=*
//         SET QUOTE=''''
//         SET HOME=&QUOTE.&HOME.&QUOTE.
//         SET RSECFG=&QUOTE.&RSECFG.&QUOTE.
//         SET APICFG=&QUOTE.&APICFG.&QUOTE.
//         SET SRVNUM=&SRVNUM.
//         SET SECURE=&QUOTE.&SECURE.&QUOTE.
//*
//RSEAPI   EXEC PGM=BPXBATCH,REGION=0M,TIME=NOLIMIT,
//            PARM='PGM &HOME./tomcat.base/start.sh'
//STDOUT   DD SYSOUT=*
//STDERR   DD SYSOUT=*
//STDENV   DD *,SYMBOLS=JCLONLY
_BPXK_AUTOCVT=ON
CATALINA_RUN=run
RSEAPI_CFG=&APICFG
RSE_CFG=&RSECFG
SERVER_NUM=&SRVNUM
SECURE_SERVER=&SECURE
TMPDIR=/my/tempdir
//         PEND
//*

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