$PBS_JOBID variable

PBSpro: 14.10.1
CentOS 7

Attempting to use the $PBS_JOBID variable in my job submission script as part of the the output and error file name, but when then files are generated the variable is not resolved and the filename is just outputfilename.$PBS_JOBID instead of the actual ID.
I am setting it up in the submission script as follows:


This has worked for me in a torque installation, but cannot seem to get it to work with PBSpro. Also as a test I echo the variable later in the file with:


the correct output is generated and put into the job-log.$PBS_JOBID file.

Any ideas?


I don’t recall PBS Pro ever supporting the functionality you mentioned. As a workaround, you could submit the job in held state (qsub -h) and capture the job ID returned. Then qalter the output and error paths. Release the hold on the job using qrls. These steps could be done in a wrapper script.

Thank you for the information. I guess with my other installs since I was using a combo of Torque and Maui the PBS_JOBID was accessible to me within the submission script.

PBS_JOBID is accessible within the script, but environment variables are not resolved when they’re in the #PBS directives.


Thank you for the update. I’ve decided to not set the -o and -e PBS variables and just let the default filenames be used.