Midrange News for the IBM i Community


Posted by: Bob Cozzi
Rogue Programmer
Cozzi Productions, Inc.
Chicagoland
Job-level Save/Restore Environment Question
has no ratings.
Published: 11 Apr 2014
Revised: 11 Apr 2014 - 3521 days ago
Last viewed on: 29 Nov 2023 (5456 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Job-level Save/Restore Environment Question Published by: Bob Cozzi on 11 Apr 2014 view comments(1)

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!

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: DaleB
Premium member *
Reading, PA
Comment on: Job-level Save/Restore Environment Question
Posted: 9 years 7 months 21 days 10 hours 59 minutes ago

I've done CURLIB and current directory, both of which you mentioned. How about OUTQ (and lib) or PRTDEV? Maybe message logging, LOGLVL, LOGSEV, LOGTYPE -> LOG().