Midrange News for the IBM i Community

Posted by: Bob Cozzi
Rogue Programmer
Cozzi Productions, Inc.
Save Restore Library List
has no ratings.
Published: 18 May 2012
Revised: 23 Jan 2013 - 2865 days ago
Last viewed on: 26 Nov 2020 (4987 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.

Save Restore Library List Published by: Bob Cozzi on 18 May 2012 view comments(3)

I've added two new commands to COZTOOLS:

  1. SAVLIBL - Save the library list entries to a save area
  2. RSTLIBL - Restore the library from a library list saved to the save area

They work like a PUSH and POP process (if you're familiar with those IT terms).

Basically every time you save a library list it is added to the library list save area.

Then when you run the RSTLIBL command, the last entry from the save area is restored (your job's library is changed to that saved library list) and the saved library list is removed from the save area.

This allows you to use SAVLIBL, call an application program, and then upon exiting from that program, run the RSTLIBL to return your library list to what it was before calling the application program.

Or you can run SAVLIBL, SAVLIBL, SAVLIBL, followed by one or more RSTLIBL commands and progressively restore the library list based on ever changing conditions.

Likewise you can use the RSTLIBL RMV(*NO) parameter to restore the library list, and keep the saved library list "active" so that the next RSTLIBL will retrieve the same saved library list as the previous RSTLIBL RMV(*NO) command.

So the question is, do these two commands seem at all useful in your shop? I know in at least two clients, they are constantly entering applications that screw up their library list in order to run the app, and then never restore the library list when they exit that same app.

The SAVLIBL command can be run before entering those types of apps, and then the RSTLIBL can be issued upon returning to reset the library list to what it "should" be.

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