Setting enviroment variable

Hello,

Is there a way to make PBS set (for jobs) environment variables depending on resources requested in the select statement, similar to ncpus => $NCPUS?

Creating a wrapper script to get the inputs from the user , creates the script, assign the enviroment varilable with the script $NCPUS, $MEM, $WALLTIME, $LICENSE_SERVER , $LD_LIBRARY_PATHs and qsub that script.created within the wrapper.

No, I mean creating the environments without users changing anything in their scripts etc, completely transparently. I guess the only option is a hook, right?

Yes, hooks would help here for sure.
converting the values into Variable_List.