Hmmm. As usual I get a bit confused in the i(ntegrated) world we live in on the System i. What threw me off, and lead me down the wrong path, is that the variables I set using WRKENVVAR are all available when I start Qshell, which led me to mistakenly believe that variable substitution would work in Qshell using those variables I set before I started Qshell. Well, since they ARE accessible to QShell it would be a nice enhancement if they functioned similarly to the way other Environment Variables do in Windows and Linux.
With all due respect... they DO work the way environment variables do in Windows and Linux. The dollar-sign inserting the value of an environment variable is NOT a feature of environment variables. It's a feature of the shell.
Qshell supports them exactly the way you want them to be supported... Just CL Does not. I guess I don't understand why this is a problem for you since you're running a QShell command to begin with.
You don't necessarily have to use a shell script. You can set the variable, then run your AIX utility all in one call to QSH like this:
ADDENVVAR ENVVAR(MY_HOME) VALUE('/foo') REPLACE(*YES)
STRQSH CMD('export CLASSPATH=$CLASSPATH:$MY_HOME; +
So this adds /foo to the classpath, then calls your AIX thing in one call to QShell. If you like, you can even do the ADDENVVAR separately (perhaps interactively via WRKENVVAR if that's what you're going for.)