29
Fri, Nov
0 New Articles

The Display Save Information Utility

CL
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Planning a good backup strategy requires careful attention to detail. If you forget to save one important library or operating system component, you could be in trouble the next time you need to restore it to your system. In this article, I'll present a utility that can help you analyze your backup strategy.

The Display Save Information (DSPSAVINF) command will show you information concerning the last time you saved such things as user and system libraries, documents, configuration data, and security data. Using this utility on a regular basis will not only give you information that can help you restore your system, but (more importantly) help you identify components that haven't been saved recently or (worse) never saved at all.

Overview

When you run the DSPSAVINF command, you're presented with the Save Information screen shown in 1. On this screen, you'll find a list of various save and restore operations. This information is designed to identify when a particular operation was performed and what command was used to perform it. For example, the first item in the list in 1 shows that all user libraries were saved with the SAVLIB command on 10/25/95.

When you run the DSPSAVINF command, you're presented with the Save Information screen shown in Figure 1. On this screen, you'll find a list of various save and restore operations. This information is designed to identify when a particular operation was performed and what command was used to perform it. For example, the first item in the list in Figure 1 shows that all user libraries were saved with the SAVLIB command on 10/25/95.

You can view the additional information shown in 2 by pressing F11. Here, you'll find information that can be useful if you need to perform a restore operation. For example, the first item shows that all user libraries were saved to tape volume MC at sequence number 2. You can use these values as parameters on the Restore Library (RSTLIB) command. In this case, if you needed to restore all user libraries, you might enter the following command:

You can view the additional information shown in Figure 2 by pressing F11. Here, you'll find information that can be useful if you need to perform a restore operation. For example, the first item shows that all user libraries were saved to tape volume MC at sequence number 2. You can use these values as parameters on the Restore Library (RSTLIB) command. In this case, if you needed to restore all user libraries, you might enter the following command:

 RSTLIB SAVLIB(*ALLUSR) + DEV(TAP01) VOL(MC) + SEQNBR(2) 

Another way to run the DSPSAVINF command is to use the OUTPUT(*PRINT) option. This will generate a spooled file that contains a report similar to the one shown in 3. This report contains the same information presented on the screen, but on a single page that you can print and archive for future reference.

Another way to run the DSPSAVINF command is to use the OUTPUT(*PRINT) option. This will generate a spooled file that contains a report similar to the one shown in Figure 3. This report contains the same information presented on the screen, but on a single page that you can print and archive for future reference.

The Operational Assistant backup facility, which is part of OS/400, contains a command that at first appears to be similar to the DSPSAVINF command (see "The Operational Assistant Backup Facility," MC, August 1994). The Display Backup Status (DSPBCKSTS) command allows you to display information about the tape sets used for backups and what was saved on each of them. However, only information about backups performed using the Operational Assistant backup facility is displayed. If you're not using the Operational Assistant backup facility, the DSPBCKSTS command won't show any information. The DSPSAVINF command will show you this type of information whether you use the Operational Assistant or the traditional OS/400 save commands to perform your backups.

The basic task of the DSPSAVINF utility is to retrieve and present information from the operating system concerning the last use of various OS/400 save commands. OS/400 maintains a set of data areas that contain this information in their descriptions. You could manually use the Display Object Description (DSPOBJD) command on each data area and scroll through the pages of output to locate this information. However, this utility makes it much easier by retrieving the descriptions of these data areas programatically and presenting them in a much more concise format. In the next section, I'll explain the code that allows this utility to accomplish this task.

The Nuts and Bolts

The source code for the DSPSAVINF command is shown in 4. This command accepts a single parameter called OUTPUT with two possible values: * or *PRINT. This parameter allows the user to select between sending the output to the screen or a spooled file.

The source code for the DSPSAVINF command is shown in Figure 4. This command accepts a single parameter called OUTPUT with two possible values: * or *PRINT. This parameter allows the user to select between sending the output to the screen or a spooled file.

The DSPSAVINF command executes the SAV002CL program shown in 5 as its command processing program (CPP). The SAV002CL program starts by determining if it is running in batch or interactively. If it's running in batch, it forces the output to a spooled file. Next, it executes the Display Object Description (DSPOBJD) command to create a file containing the descriptions of all data areas in QSYS that start with the letters QSAV.

The DSPSAVINF command executes the SAV002CL program shown in Figure 5 as its command processing program (CPP). The SAV002CL program starts by determining if it is running in batch or interactively. If it's running in batch, it forces the output to a spooled file. Next, it executes the Display Object Description (DSPOBJD) command to create a file containing the descriptions of all data areas in QSYS that start with the letters QSAV.

These data areas, which I mentioned earlier, contain save and restore information in their descriptions. Once the DSPOBJD command is run, this information is placed into a file called SAV002PF in QTEMP. Next, the SAV002CL program retrieves the system name to place on the report and calls an RPG program to display or print the information stored in the newly created SAV002PF file.

To display the information on the screen, this utility uses the display file SAV002DF (shown in 6). This display file contains two subfiles, one for each of the views the user can toggle between using F11. To create the report, the utility uses the printer file SAV002PR, shown in 7. These two files are used by the SAV002RG program, shown in 8.

To display the information on the screen, this utility uses the display file SAV002DF (shown in Figure 6). This display file contains two subfiles, one for each of the views the user can toggle between using F11. To create the report, the utility uses the printer file SAV002PR, shown in Figure 7. These two files are used by the SAV002RG program, shown in Figure 8.

The SAV002RG program begins by opening either the printer file or the display file, depending on the value of the OUTPUT parameter. The program then drops into a read loop, where it reads the output file created by the DSPOBJD command. Within the read loop, the program either prints detail lines to the printer file or writes subfile records to the display file. After all the records have been read, the program either prints the report footing or displays the screen to the user. If it displays the screen, it performs a loop that executes as long as the user presses F11. Within this loop, the program alternates between displaying the two subfiles. When the user presses Enter, F3, or F12, the program ends.

Considerations

The DSPSAVINF utility will give you information about most of the save operations you can perform on the AS/400. However, there are a few that won't be shown. For example, if you use the Save Library (SAVLIB) command to save individual libraries by name rather than specifying *ALLUSR, you won't see that reflected in the output. However, there is enough information presented by this utility to give you a good representation of the status of your backup strategy.

There are several ways to use the DSPSAVINF utility. The most obvious is to use it interactively to display the results at your terminal. However, you might also consider placing this command at the end of your backup procedure and sending the output to a printer. You could then archive copies of this report so that, in the event of a system failure, you would have them available to assist you in determining the information you need to restore your system. Another way to run this command regularly would be to put it into an entry in the OS/400 job scheduler so it runs automatically every day. That way, you would always have a recent copy of the report if the need arises. No matter which way you decide to implement this utility in your shop, I hope you find it a useful tool that can help you improve the quality and reliability of your backup strategy.

Robin Klima is a senior technical editor at Midrange Computing.

REFERENCES

OS/400 Backup and Recovery?Advanced V3R1 (SC41-3305, CD-ROM QBKALF00).

OS/400 Backup and Recovery?Basic V3R1 (SC41-3304, CD-ROM QBKALE01).

The Display Save Information Utility

Figure 1: The Save Information Screen


The Display Save Information Utility

Figure 2: The Save Information Alternate View



The Display Save Information Utility

Figure 3: The Save Information Report

 10/25/95 9:47:40 Save Information System: MCPGMR Save Restore Save Device Saved Seq File Description Date Date Command Type Volume Nbr Label SAVE/RESTORE LIB(*ALLUSR) 10/25/95 SAVLIB Tape MC 2 QFILE SAVE CONFIGURATION 10/25/95 SAVCFG Tape MC 116 QFILEIOC SAVDLO *ALL 10/25/95 4/12/95 SAVDLO Tape MC 1 QDOC SAVE/RESTORE LIB(*IBM) 7/27/94 7/30/94 SAVLIB Tape MC 13 QFILE SAVE/RESTORE LIB(*NONSYS) 8/19/94 SAVLIB Tape MC 13 QFILE SAVE STORAGE SAVE SYSTEM 3/18/95 SAVSYS Tape MC 1 QFILEIML RESTORE USER PROFILES 10/25/95 SAVSECDTA Tape MC 117 QFILEUPR * * * * * E N D O F L I S T I N G * * * * * 
The Display Save Information Utility

Figure 4: The DSPSAVINF Command

 /*===============================================================*/ /* To compile: */ /* */ /* CRTCMD CMD(XXX/DSPSAVINF) PGM(XXX/SAV002CL) + */ /* SRCFILE(XXX/QCMDSRC) */ /* */ /*===============================================================*/ CMD PROMPT('Display Save Information') PARM KWD(OUTPUT) TYPE(*CHAR) LEN(6) RSTD(*YES) + DFT(*) VALUES(* *PRINT) PROMPT('Output') 
The Display Save Information Utility

Figure 5: CL Program SAV002CL

 /*===============================================================*/ /* To compile: */ /* */ /* CRTCLPGM PGM(XXX/SAV002CL) SRCFILE(XXX/QCLSRC) */ /* */ /*===============================================================*/ PGM PARM(&OUTPUT) DCL VAR(&OUTPUT) TYPE(*CHAR) LEN(6) DCL VAR(&TYPE) TYPE(*CHAR) LEN(1) DCL VAR(&SYSNAME) TYPE(*CHAR) LEN(8) DCL VAR(&MSGID) TYPE(*CHAR) LEN(7) DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(80) /* Send all errors to error handling routine */ MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(ERROR)) /* If running in batch send output to *PRINT */ RTVJOBA TYPE(&TYPE) IF COND(&TYPE *EQ '0') THEN(CHGVAR VAR(&OUTPUT) + VALUE('*PRINT')) /* Create output file */ DSPOBJD OBJ(QSYS/QSAV*) OBJTYPE(*DTAARA) + DETAIL(*FULL) OUTPUT(*OUTFILE) + OUTFILE(QTEMP/SAV002PF) /* Retrieve system name */ RTVNETA SYSNAME(&SYSNAME) /* Call program to display save information */ OVRDBF FILE(QADSPOBJ) TOFILE(QTEMP/SAV002PF) CALL PGM(SAV002RG) PARM(&OUTPUT &SYSNAME) DLTOVR FILE(QADSPOBJ) /* Branch around error handling routine */ GOTO CMDLBL(ENDPGM) /* Error handling routine */ ERROR: RCVMSG MSGTYPE(*EXCP) MSGDTA(&MSGDTA) MSGID(&MSGID) SNDPGMMSG MSGID(&MSGID) MSGF(QCPFMSG) MSGDTA(&MSGDTA) + MSGTYPE(*ESCAPE) ENDPGM: ENDPGM 
The Display Save Information Utility

Figure 7: Printer File SAV002PR

 *=============================================================== * To compile: * * CRTPRTF FILE(XXX/SAV002PR) SRCFILE(XXX/QDDSSRC) * *=============================================================== *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 A R PRTHDR A 1 1DATE(*SYS) EDTCDE(Y) A 1 12TIME EDTWRD(' : : ') A 1 59'Save Information' A 1114'System:' A SYSNAM 8 O 1122 A 3 33'Save' A 3 45'Restore' A 3 60'Save' A 3 75'Device' A 3 89'Saved' A 3103'Seq' A 3114'File' A 4 2'Description' A 4 33'Date' A 4 46'Date' A 4 60'Command' A 4 75'Type' A 4 89'Volume' A 4103'Nbr' A 4114'Label' A R PRTDTL SPACEB(1) A SAVDSC 27 O 2 A SAVDAT 6 0O 31EDTWRD(' / / ') A RSTDAT 6 0O 44EDTWRD(' / / ') A ODSCMD 10 O 60 A ODSDEV 10 O 75 A ODSV01 6 O 89 A ODSSQN 4 0O 102EDTCDE(4) A ODLBL 17 O 114 A R PRTFTR SPACEB(2) A 41'* * * * *' A 53'E N D O F L I S T I N G' A 83'* * * * *' *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
The Display Save Information Utility

Figure 8: RPG Program SAV002RG

 *=============================================================== * To compile: * * CRTRPGPGM PGM(XXX/SAV002RG) SRCFILE(XXX/QRPGSRC) * *=============================================================== *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 FQADSPOBJIF E DISK FSAV002PRO E PRINTER UC FSAV002DFCF E WORKSTN UC F RRN KSFILE DSPDTL1 F RRN KSFILE DSPDTL2 * C *ENTRY PLIST C PARM OUTPUT 6 C PARM SYSNAM 8 * * Open either the print file or the display file C OUTPUT IFEQ '*PRINT' C OPEN SAV002PR C WRITEPRTHDR C ELSE C OPEN SAV002DF C ENDIF * C READ QLIDOBJD 99 C *IN99 DOWEQ*OFF C MOVE ODOBTX SAVDSC C MOVE ODSDAT SAVDAT C MOVE ODRDAT RSTDAT * * Print detail line or write record to subfile C OUTPUT IFEQ '*PRINT' C WRITEPRTDTL C ELSE C ADD 1 RRN 50 C MOVE *ON *IN90 C WRITEDSPDTL1 C WRITEDSPDTL2 C ENDIF * C READ QLIDOBJD 99 C ENDDO * * Print footer or display screen C OUTPUT IFEQ '*PRINT' C WRITEPRTFTR C ELSE C *IN11 DOUEQ*OFF C *IN50 IFEQ *OFF C WRITEDSPHDR1 C MOVE *ON *IN50 C ELSE C WRITEDSPHDR2 C MOVE *OFF *IN50 C END C EXFMTDSPFTR C ENDDO C ENDIF * C MOVE *ON *INLR *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: