Run Confirmation Window

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

In my shop, many people have access to PDM-operators as well as programmers. I wanted to have a warning come up any time someone tried to use the user-defined option 'C' to call a program from PDM. I came up with a pop-up window that overlays the PDM screen and asks the users to confirm that they want to run the program.

I replaced the user-defined option 'C', which resides in the QAUOOPT file, with a call to my command, CALLPGM (see 7). I passed the library (&L) and object name (&N) supplied by PDM. The Command Processing Program (CPP) for the command is PGM006CL (see 8).

I replaced the user-defined option 'C', which resides in the QAUOOPT file, with a call to my command, CALLPGM (see Figure 7). I passed the library (&L) and object name (&N) supplied by PDM. The Command Processing Program (CPP) for the command is PGM006CL (see Figure 8).

Display file PGM006DF (see 9, page 74) uses the ASSUME and PUTOVR keywords and is compiled with the USRDSP option set to *YES. The window overlays the screen without erasing it. The option defaults to 'N' so that accidentally hitting the Enter key won't start the program. I display the library and the object name in the window so that users know exactly what program they are trying to run.

Display file PGM006DF (see Figure 9, page 74) uses the ASSUME and PUTOVR keywords and is compiled with the USRDSP option set to *YES. The window overlays the screen without erasing it. The option defaults to 'N' so that accidentally hitting the Enter key won't start the program. I display the library and the object name in the window so that users know exactly what program they are trying to run.

While this program doesn't prevent someone from accidentally running a dangerous program, it helps to slow them down and confirm their choices.

-Michael Veit


Run Confirmation Window

Figure 7 The CALLPGM Command

 /*==================================================================*/ /* To compile: */ /* */ /* CRTCMD CMD(XXX/CALLPGM) PGM(XXX/PGM006CL) + */ /* SRCFILE(XXX/QCMDSRC) */ /* */ /*==================================================================*/ CALLPGM: CMD PROMPT('Call Program') PARM KWD(PGMNAME) TYPE(QUAL) PROMPT('Program name') QUAL: QUAL TYPE(*NAME) LEN(10) MIN(1) QUAL TYPE(*NAME) LEN(10) DFT(*LIBL) + SPCVAL((*LIBL)) PROMPT('Library') 
Run Confirmation Window

Figure 8 CPP CL Program PGM006CL

 /*==================================================================*/ /* To compile: */ /* */ /* CRTCLPGM PGM(XXX/PGM006CL) SRCFILE(XXX/QCLSRC) */ /* */ /*==================================================================*/ PGM005CL: PGM PARM(&QNAME) DCL VAR(&QNAME) TYPE(*CHAR) LEN(20) DCL VAR(&LIB) TYPE(*CHAR) LEN(10) DCL VAR(&NAME) TYPE(*CHAR) LEN(10) DCL VAR(&DEV) TYPE(*CHAR) LEN(10) DCLF FILE(PGM006DF) CHGVAR VAR(&NAME) VALUE(%SST(&QNAME 1 10)) CHGVAR VAR(&LIB) VALUE(%SST(&QNAME 11 10)) RTVJOBA JOB(&DEV) CHGVAR VAR(&DRSPNC) VALUE('N') SNDRCVF DEV(&DEV) RCDFMT(SCRWIN) WAIT(*YES) IF COND(&IN12 *EQ '1') THEN(GOTO CMDLBL(ENDPGM)) IF COND(&DRSPNC *EQ 'Y') THEN(DO) CALL PGM(&LIB/&NAME) MONMSG MSGID(CPF0000) EXEC(DO) SNDBRKMSG MSG('Program could not execute properly') + TOMSGQ(&DEV) ENDDO ENDDO ENDPGM: ENDPGM 
Run Confirmation Window

Figure 9 Display File PGM006DF

 *=============================================================== * To compile: * * CRTDSPF FILE(XXX/PGM006DF) SRCFILE(XXX/QDDSSRC) * *=============================================================== *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 A DSPSIZ(24 80 *DS3) A CA12(12) A R DUMMY A PUTOVR A ASSUME A 1 2' ' A R SCRWIN A WINDOW(7 40 7 20) A OVERLAY A WDWBORDER((*COLOR WHT)) A WDWBORDER((*DSPATR RI)) A WDWBORDER((*CHAR ' ')) A 2 3'Confirm you want' A 3 8'to run:' A NAME 10A O 4 6COLOR(WHT) A 5 3'(Y = Yes, N = No)' A DRSPNC 1A B 6 11 
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: