Home > Ask the AS/400 Experts > iSeries Backup and Recovery Questions & Answers > Sending a message to an output file after backup completion
Ask The iSeries 400 Expert: Questions & Answers
EMAIL THIS

Sending a message to an output file after backup completion

Ken Graap EXPERT RESPONSE FROM: Ken Graap

Pose a Question
Other iSeries 400 Categories
Meet all iSeries 400 Experts
Become an Expert for this site


iSeries news and advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


>
QUESTION POSED ON: 01 May 2008
How can you send a message to an output file from scheduled back-up -- after being successfully completed or otherwise?


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
iSeries Backup and Recovery
Authority restrictions on the AUTL on backup/test systems and AUTL on live system
Perform a full system backup without user profile QSECOFR
Faster backup method for System i
Solve problems concerning the ALLOW OBJECT DIFFERENCES parameter when restoring a library
System i backup not advised using network NETBACKUP
How to clear expired BRMS created *SAVF files from System i
Restore a full system backup from the production partition to the test partition
Remove a media with a *PERM expiration date from the inventory
Booting iSeries from internal or external sources
SAVF by FTP on AS/400 -- error "source file not found"

Data backup, storage and retrieval on iSeries
Authority restrictions on the AUTL on backup/test systems and AUTL on live system
Perform a full system backup without user profile QSECOFR
Faster backup method for System i
Solve problems concerning the ALLOW OBJECT DIFFERENCES parameter when restoring a library
System i backup not advised using network NETBACKUP
How to clear expired BRMS created *SAVF files from System i
Restore a full system backup from the production partition to the test partition
Tivoli Service Manager 6 released with DB2 integration and dedupe
Remove a media with a *PERM expiration date from the inventory
Booting iSeries from internal or external sources
Data backup, storage and retrieval on iSeries Research

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


I suggest that you create a special message queue for backup processes and send completion and/or error messages there instead of trying to write them to spool or to a physical file. It is much easier and just as functional

Use the CRTMSGQ command to create your Message Queue. For example, to create a message queue in library QGPL:

CRTMSGQ MSGQ(QGPL/BACKUPMSGS) 
      TEXT('Messages from Backup Processes') 
      SIZE(5 1 10) 
      MSGQFULL(*WRAP)                                                        
 

Use the SNDPGMMSG command to send messages to it.

Here is some example CLP code showing how to capture and resend error messages and a completion message, to a particular message queue:

             PGM                                                       
/* ************************************************************** */   
/*                                                                */   
/* DECLARE PROGRAM VARIABLES                                      */   
/*                                                                */   
/* ************************************************************** */   
             DCL        &ERRORSW *LGL                     /* Std err */
             DCL        &MSGID *CHAR LEN(7)               /* Std err */
             DCL        &MSGDTA *CHAR LEN(100)            /* Std err */
             DCL        &MSGF *CHAR LEN(10)               /* Std err */
             DCL        &MSGFLIB *CHAR LEN(10)            /* Std err */
/* ************************************************************** */   
/*                                                                */   
 /* GLOBAL MESSAGE MONITOR                                         */   
 /*                                                                */   
 /* ************************************************************** */   
              MONMSG     MSGID(CPF0000) EXEC(GOTO CMDLBL(STDERR1))      
 /* ************************************************************** */   
 /*                                                                */   
 /* PROGRAM LOGIC                                                  */ 
 /*                                                                */   
 /* ************************************************************** */ 
                                                                  
            /* your backup code would go here */

SNDPGMMSG  MSGID(CPF9898) MSGF(QCPFMSG) +           
MSGDTA('Backups have completed normally) + 
          TOMSGQ(QGPL/BACKUPMSGS) +    
          MSGTYPE(*COMP)                               
 /* ************************************************************** */ 
 /*                                                                */ 
 /* NORMAL END OF PROGRAM                                          */ 
 /*                                                                */ 
 /* ************************************************************** */ 
  END:        RETURN                                                  
 /* ************************************************************** */ 
 /*                                                                */ 
 /* STANDARD ERROR PROCESSING                                      */ 
 /*                                                                */ 
 /* ************************************************************** */ 
  STDERR1:               /* Standard error handling routine */        
    IF         &ERRORSW SNDPGMMSG MSGID(CPF9999) +          
    IF         &ERRORSW SNDPGMMSG MSGID(CPF9999) +            
                 MSGF(QCPFMSG) MSGTYPE(*ESCAPE) /* Func chk */
             CHGVAR     &ERRORSW '1' /* Set to fail ir error occurs */ 
 STDERR2:    RCVMSG     MSGTYPE(*DIAG) MSGDTA(&MSGDTA) MSGID(&MSGID) + 
                  MSGF(&MSGF) MSGFLIB(&MSGFLIB)                
   IF         (&MSGID *EQ '       ') GOTO STDERR3            
      SNDPGMMSG  MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) +           
                   MSGDTA(&MSGDTA) TOMSGQ(QGPL/BACKUPMSGS) +    
                   MSGTYPE(*INFO)                               
      SNDPGMMSG  MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) +           
                   MSGDTA(&MSGDTA) MSGTYPE(*DIAG)               
      GOTO       STDERR2 /* Loop back for addl diagnostics */   
 STDERR3:    RCVMSG     MSGTYPE(*EXCP) MSGDTA(&MSGDTA) MSGID(&MSGID) + 
                   MSGF(&MSGF) MSGFLIB(&MSGFLIB)                
        SNDPGMMSG  MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) +           
                   MSGDTA(&MSGDTA) TOMSGQ(QGPL/BACKUPMSGS) +    
                   MSGTYPE(*INFO)                               
        SNDPGMMSG  MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) +           
                   MSGDTA(&MSGDTA) MSGTYPE(*ESCAPE)             
     ENDPGM                                                    

To view these messages you would use the command: DSPMSG MSGQ(QGPL/BACKUPMSGS)




Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



iSeries Networking - Printing, Remote Access, TCP/IP
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts