26
Fri, Apr
1 New Articles

TechTalk: SAVNONSYS Command

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

I have heard a lot of complaints about the SAVLIB *NONSYS command. This command requires a dedicated system and backs up many unnecessary libraries. I use my SAVNONSYS program (1) to back up all libraries that do not start with # or Q (plus the QS36F library). This program also keeps track of the last library backed up. If more than one tape is required to perform the backup, the program will use the reply list to abort the backup. When the backup is restarted it will continue with the next library to be saved.

I have heard a lot of complaints about the SAVLIB *NONSYS command. This command requires a dedicated system and backs up many unnecessary libraries. I use my SAVNONSYS program (Figure 1) to back up all libraries that do not start with # or Q (plus the QS36F library). This program also keeps track of the last library backed up. If more than one tape is required to perform the backup, the program will use the reply list to abort the backup. When the backup is restarted it will continue with the next library to be saved.

SAVNONSYS is called with one parameter containing the backup device (only tape devices are supported). The ADDRPYLE command is used to add 'C'ancel reply for message CPA4088 (load next tape on device). This is done in order to end the job when the end of tape is reached. The next statement checks to see if the SAVNONSYS data area exists. I use the MONMSG command to condition the creation of the data area. The CHGJOB command is used to change the log option to display first level messages and to specify that pre-defined messages are answered using the system reply list. (The first level message logging will produce a log of all the libraries that were saved and the number of objects saved from each library). The message queue is changed to *NOTIFY in order to prevent messages from suspending the job. (If your message queue is in *BREAK mode and a message arrives, the interactive job will be suspended until you get out of the message queue display).

The display object description command is used to create a list of all the libraries on the system. The list is directed to file ##LIBS in QTEMP. The last saved library name is retrieved from the data area into variable &STRTLIB, if the last library saved was QS36F, &STRTLIB is cleared.

The main processing loop will bypass any library starting with "#" or "Q" and any library that is less than the last library saved. Before each save attempt, the pre-check value is retrieved from the data area. If pre-check is *YES, all objects in the library must be available for a successful save. If the value is *NO, the save will bypass locked objects. Message CPF3771 is considered a successful save. All other CPF3700 messages will result in a message to QSYSOPR and a 60 second delay before the save operation will be retried. At the end of each save, the data area is updated with the name of the library. When the end of file is reached, the QS36F library is saved. At the end of the program a job log is printed and the system reply list entry is removed.

Alon Fluxman Highlands Ranch, Colorado


TechTalk: SAVNONSYS Command

Figure 1 The SAVNONSYS program

 SAVNONSYS: + PGM PARM(&BACKUPDEV) DCL VAR(&BACKUPDEV) TYPE(*CHAR) LEN(10) DCL VAR(&PRECHK) TYPE(*CHAR) LEN(4) DCL VAR(&STRTLIB) TYPE(*CHAR) LEN(10) DCLF FILE(QADSPOBJ) ADDRPYLE SEQNBR(101) MSGID(CPA4088) RPY('C') MONMSG MSGID(CPF2555) EXEC(DO) SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('Reply id 101 + already on system reply list ') MSGTYPE(*ESCAPE) ENDDO CHKOBJ OBJ(SAVNONSYS) OBJTYPE(*DTAARA) MONMSG MSGID(CPF9800) EXEC(DO) CRTDTAARA DTAARA(QGPL/SAVNONSYS) TYPE(*CHAR) LEN(20) VALUE(' - *YES') ENDDO CHGJOB LOG(*SAME *SAME *MSG) INQMSGRPY(*SYSRPYL) CHGMSGQ MSGQ(QSYSOPR) DLVRY(*NOTIFY) MONMSG MSGID(CPF2451) INZTAP DEV(&BACKUPDEV) NEWVOL(NONSYS) CHECK(*NO) MONMSG MSGID(CPF6760) EXEC(DO) SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('NONSAVSYS + backup ended abnormally .. Missing tape') MSGTYPE(*ESCAPE) ENDDO DSPOBJD OBJ(QSYS/*ALL) OBJTYPE(*LIB) OUTPUT(*OUTFILE) + OUTFILE(QTEMP/##LIBS) RTVDTAARA DTAARA(SAVNONSYS (1 10)) RTNVAR(&STRTLIB) IF COND(&STRTLIB *EQ 'QS36F') THEN(CHGVAR VAR(&STRTLIB) VALUE(' - ')) OVRDBF FILE(QADSPOBJ) TOFILE(QTEMP/##LIBS) READ: + RCVF MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(SAVEQS36)) IF COND(%SST(&ODOBNM 1 1) *EQ '#' *OR %SST(&ODOBNM 1 1) *EQ 'Q') + THEN(GOTO CMDLBL(READ)) IF COND(&ODOBNM *LE &STRTLIB) THEN(GOTO CMDLBL(READ)) SAVE: + RTVDTAARA DTAARA(SAVNONSYS (11 4)) RTNVAR(&PRECHK) IF COND(&PRECHK *NE '*NO ') THEN(CHGVAR VAR(&PRECHK) VALUE('*YES')) SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('Backup started + for library ' *CAT &ODOBNM) TOPGMQ(*EXT) MSGTYPE(*STATUS) SAVLIB LIB(&ODOBNM) DEV(&BACKUPDEV) ENDOPT(*LEAVE) CLEAR(*ALL) + PRECHK(&PRECHK) DTACPR(*YES) MONMSG MSGID(CPF4901 CPF3742 CPF5104 CPF3794) EXEC(GOTO + CMDLBL(ENDPGM)) MONMSG MSGID(CPG3771) EXEC(GOTO CMDLBL(CHGDTA)) MONMSG MSGID(CPF3700) EXEC(DO) SNDUSRMSG MSG('Library ' *CAT *ODOBNM *CAT ' cannot be saved + now. The program will try again in 60 seconds') + MSGTYPE(*INFO) TOMSGQ(*SYSOPR) DLYJOB DLY(60) GOTO CMDLBL(SAVE) ENDDO CHGDTA: + CHGDTAARA DTAARA(SAVNONSYS (1 10)) VALUE(&ODOBNM) GOTO CMDLBL(READ) SAVEQS36: + SAVLIB LIB(QS36F) DEV(&BACKUPDEV) ENDOPT(*LEAVE) CLEAR(*ALL) + PRECHK(*YES) DTACPR(*YES) MONMSG MSGID(CPF3700) EXEC(DO) SNDUSRMSG MSG('Library QS36F cannot be saved now. The program + will try again in 60 seconds') MSGTYPE(*INFO) TOMSGQ(*SYSOPR) DLYJOB DLY(60) GOTO CMDLBL(SAVEQS36) ENDDO CHGDTAARA DTAARA(SAVNONSYS (1 10)) VALUE(QS36F) ENDPGM: + DSPJOBLOG JOB(*) OUTPUT(*PRINT) RMVRPYLE SEQNBR(101) ENDPGM 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$0.00 Raised:
$

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: