|
When I read the list yesterday and Rob said to use DSPOBJD *DEVD *OUTFILE to get the information I wanted this took me all of about 10 minutes to write/test (if that). I have another program called RLSDSPCL that I just replaced the HLDCMNDEV with RLSCMNDEV. It exempts all my personal displays along with which ever display might be used for the save. I simply put my HLDDSPCL in front of my save and RLSDSPCL after. Works like a charm! Using the CL to read the file may be a bit primitive but for something so small I couldn't bring myself to throw RPG into the mix. While I love the PICNIC term (kudos on that) I don't think it would go over well here. LOL Ending QINTER was a good idea but sometimes I like to do the save in the middle of the day (lunch hour) on Friday and this gives me the ability to send a message with "STAY OFF" instructions and start the save. Using the SAVACT would've been nice if it could reach checkpoints quickly in *SYNCLIB mode (not very likely). Using *SYSDFN mode would cause me a nightmare due to the inconsistencies. The only thing I did not understand in my testing is when doing ALCOBJ *EXCL with a device, then putting the device on hold, it still shows that it is locked when doing DSPOBJLCK. But as long as the device is HELD it doesn't matter. it still saves the file. Oh well. my program works. that's all that matters. Thanks for all your help and ideas . /********************************************************************/ /* PROGRAM: QGPL/HLDDSPCL */ /* */ /* PURPOSE: HOLD DISPLAY DEVICES */ /* */ /* AUTHOR: BILL FRANCIS */ /* DATE: 09/26/2005 */ /* */ /* FIELD DESCRIPTIONS: */ /* ------------------- */ /* &ODOBNM - File QADSPJOBD (24-33) Device Name */ /* &ODOBAT - File QADSPJOBD (42-51) Device Attribute */ /* Contains "DSPLCL" or "DSPVRT" for display devices */ /* &DISPLAY - %SST extracts the first 3 characters of &ODOBAT to */ /* this field so it may be tested as a "DSP" device */ /* &JOBNAME - Job (device) running this program */ /********************************************************************/ PGM DCLF FILE(QGPL/QADSPOBJD) DCL VAR(&DEVICE) TYPE(*CHAR) LEN(10) DCL VAR(&DISPLAY) TYPE(*CHAR) LEN(3) DCL VAR(&JOBNAME) TYPE(*CHAR) LEN(10) RTVJOBA JOB(&JOBNAME) DLTF FILE(QGPL/DSPOBJD) MONMSG MSGID(CPF2105) /* object not found */ DSPOBJD OBJ(*ALL) OBJTYPE(*DEVD) OUTPUT(*OUTFILE) + OUTFILE(QGPL/QADSPOBJD) /*-----------------------------------------------------*/ /* Loop to read all records in file QADSPOBJD */ /*-----------------------------------------------------*/ LOOP: RCVF /* read QADSPOBJD record */ MONMSG MSGID(CPF0864) EXEC(DO) /* end of file */ GOTO CMDLBL(END) ENDDO CHGVAR VAR(&DISPLAY) VALUE(%SST(&ODOBAT 1 3)) IF COND(&DISPLAY *EQ 'DSP') THEN(DO) IF COND(&ODOBNM *NE &JOBNAME *AND + (&ODOBNM *NE 'BILL1 ') *AND + (&ODOBNM *NE 'BILL2 ') *AND + (&ODOBNM *NE 'BILLPC ') *AND + (&ODOBNM *NE 'BILLHOME ')) THEN(DO) HLDCMNDEV DEV(&ODOBNM) OPTION(*IMMED) ENDDO ENDDO GOTO CMDLBL(LOOP) /*-----------------------------------------------------*/ END: ENDPGM -Bill
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.