× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



David,
I've seen many answers to your question, most of them pointing to exit program.
Let me point in a totally different direction:


CLROUTQ command (as most other commands) has no Validity Check program.
I once had a similar problem.
Take a look at the short sample program I'm including further down.
It's a CL one (I named it "Checker"), which will call an RPG pgm ("CheckRPG") where you can do anything you want (log it to a file, or whatever, depending on the user, outq and library. In my case, I had a small table of users and outq's to check it against. If accepted, the RPG pgm should return a (char) "1". Any other value (var RC in the CL) will cause a DIAG message CPD0006, followed by a Escape CPF0002 message (standard).
Once you have both pgms ready, change the command (CHGCMD) assigning the CL pgm as ValidityCheckingProgram for the CLROUTQ command.


Obviously, there is a small problem: next time you upgrade your OS/400 to next Version, command CLROUTQ will be overlaid from IBM CD's, so you'll have to remember re-change!!!

Also, as Rob Dekko pointed out, beware of secondary languages you may have installed...

HTH,
---------------------------
PGM         (&P1 &OUTQLIB &P3)
 DCL        &P1        *CHAR  1
 DCL        &OUTQLIB   *CHAR 20
 DCL        &P3        *CHAR  1

 DCL        &OUTQ      *CHAR 10
 DCL        &LIB       *CHAR 10
 DCL        &RC        *CHAR  1

    CHGVAR     &OUTQ   %SST(&OUTQLIB  1 10)
    CHGVAR     &LIB    %SST(&OUTQLIB 11 10)

CALL CHECKRPG (&OUTQ &LIB &RC) /* RPG PGM for whatever you need to do */

    IF (&RC *NE '1') THEN(DO)          /* If RC<>'1' then reject command */
       SNDPGMMSG  MSGID(CPD0006) MSGF(QCPFMSG) MSGTYPE(*DIAG)     +
                  MSGDTA('0000 You are NOT AUTHORIZED to Queue' *BCAT     +
                          &OUTQ *BCAT 'in Library' *BCAT &LIB)
       SNDPGMMSG  MSGID(CPF0002) MSGF(QCPFMSG) MSGTYPE(*ESCAPE)
       ENDDO
 ENDDO

ENDPGM
----------------------------
David A Parnin wrote:

Good morning all,

We have a situation where someone appears to be clearing an outq for a
printer used by many people.  There's no real need for any user to be using
the CLROUTQ command or choosing option 14 from WRKOUTQ.  What we would like
to do is to log the user-id of people trying to do this and give an error
message to any non-MIS people.

My boss initially suggested creating a modified CLROUTQ command that was
higher in the library list than the system command. Over the weekend I
started wondering if an exit program could do the job. I've never
attempted an exit program before but wouldn't mind learning. I've seen
examples for FTP and Telnet in the archives but can they be added for any
command?


--
Antonio Fernandez-Vicenti
afvaiv@xxxxxxxxxx




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.