Checking For Disk Errors

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

Q: Is there a way that I can automatically scan the error log for disk errors and notify the operators when one is found?

A: In Figures 1 and 2 you can see the source for the Check Disk Error (CHKDSKERR) command that I use to do what you described. The program prints the error log, then copies it to a physical file. It then uses QCLSCAN to check for certain error codes. In the sample program, it is looking for error code 6109. You may need to modify the program to look for error codes that pertain to your site. If it finds the specified code in the listing, the program sends a message to the system operator message queue. Then the operator can review the error log using the Print Error Log (PRTERRLOG) command.


Checking For Disk Errors

Figure 1 PRL001CL CL Source

 /*==================================================================*/ /* To compile: */ /* */ /* CRTCLPGM PGM(XXX/PRL001CL) SRCFILE(XXX/QCLSRC) */ /* */ /*==================================================================*/ PRL001CL: PGM PARM(&BEGDATE) DCLF FILE(LISTFILE) DCL VAR(&BEGDATE) TYPE(*CHAR) LEN(6) DCL VAR(&LEN) TYPE(*DEC) LEN(3 0) VALUE(132) DCL VAR(&FROM) TYPE(*DEC) LEN(3 0) VALUE(1) DCL VAR(&RESULT) TYPE(*DEC) LEN(3 0) DCL VAR(&SCLEN) TYPE(*DEC) LEN(3 0) VALUE(4) MONMSG MSGID(CPF0000) CRTPF FILE(QTEMP/LISTFILE) RCDLEN(132) SIZE(*NOMAX) OVRPRTF FILE(QPCSMPRT) HOLD(*YES) PRTERRLOG PERIOD((000001 &BEGDATE) (*AVAIL)) CPYSPLF FILE(QPCSMPRT) TOFILE(QTEMP/LISTFILE) + SPLNBR(*LAST) MBROPT(*REPLACE) DLTOVR FILE(QPCSMPRT) DLTSPLF FILE(QPCSMPRT) SPLNBR(*LAST) READ: RCVF MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(ENDPGM)) CALL PGM(QCLSCAN) PARM(&LISTFILE &LEN &FROM + '6109' &SCLEN '' '' '' &RESULT) IF COND(&RESULT *GT 0) THEN(DO) SNDMSG MSG('DISK ERROR ---> REVIEW PRTERRLOG + LISTING') TOUSR(*SYSOPR) GOTO CMDLBL(ENDPGM) ENDDO GOTO CMDLBL(READ) ENDPGM: DLTF FILE(QTEMP/LISTFILE) ENDPGM 
Checking For Disk Errors

Figure 2 CHKDSKERR Command Source

 /*==================================================================*/ /* To compile: */ /* */ /* CRTCMD CMD(XXX/CHKDSKERR) PGM(XXX/PRL001CL) + */ /* SRCFILE(XXX/QCMDSRC) */ /* */ /*==================================================================*/ CHKDSKERR: CMD PROMPT('Check For Disk Errors') PARM KWD(DATE) TYPE(*CHAR) LEN(6) RANGE('000000' + '999999') MIN(1) PROMPT('Date To Look For + Disk Error') 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • 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.

  • 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

  • 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: