I've been using my own SAVLIBL/RSTLIBL commands to save the library list (including *CURLIB) at the top of legacy CL programs that muck with the library list and current lib, and then restoring it upon completion.
MYLEGACY: PGM /* dcl stmts */ MONMSG CPF0000 SAVLIBL ... /* Do legacy CL crap here */ RSTLIBL ENDPGM: ENDPGM
This is pretty simple and safe.
What I'm wondering is what other "environment" (i.e., job settings) should I consider? I ask because I'm going to create a SAVENV/RSTENV command that has options for library list, current library, date, current directory, logCLPgm, etc.
Are there any specific job attributes that should be included and if you are doing something like this, what are you saving/restoring? Thanks!