Tip

Where did my output print?

How many times does someone call your help desk asking, "Where did my output go?" Here's a simple command and program that will help you answer that question.

The first thing you have to do is change your system value QAUDLVL to include *SPLFDTA. This will start journalling spooled file functions. Once this data starts collecting, you're ready to answer the user's question.


/********************************************************************/
/*                                                                  */
/* Command name: UTUWHERE                                           */
/* System name:  Utility                                            */
/* Author:       Mary C. Milliron                                   */
/*                                                                  */
/* Command Narrative:                                               */
/*                                                                  */
/*   This command will display journal entries for a user and       */
/*  display all the spool files that were printed for the user      */
/*  and where.                                                      */
/*                                                                  */
/* Command Processing Program:                                      */
/*                                                                  */
/*   UTJWHERE                                                       */
/*                                                                  */
/********************************************************************/
 UTUWHERE:   CMD        PROMPT('Where Did My Spool File Print?')
             PARM       KWD(USER) TYPE(*CHAR) LEN(10) MIN(1) +
                          PROMPT('User')
             PARM       KWD(DAYTE) TYPE(*CHAR) LEN(6) MIN(1) +
                          PROMPT('Date Output Created(mmddyy)')


/*********************************************************************/
/*                                                                   */
/* Program name: UTJWHERE                                            */
/* System name:  Utility                                             */
/* Author:       Mary C. Milliron                                    */
/*                                                                   */
/* Program Narrative:                                                */
/*                                                                   */
/*   This program will display the journal entries related to        */
/*  where user's spool files last printed.                           */
/*                                                                   */
/* Compiler Options:                                                 */
/*                                                                   */
/*   Compile with QSECOFR authority.                                 */
/*                                                                   */
/*********************************************************************/
             PGM        PARM(&USER &DAYTE)
             DCL        VAR(&USER) TYPE(*CHAR) LEN(10)
             DCL        VAR(&DAYTE) TYPE(*CHAR) LEN(6)

             CRTDUPOBJ  OBJ(QAPTACG) FROMLIB(QSYS) OBJTYPE(*FILE) +
                          TOLIB(QTEMP) NEWOBJ(T2)
             MONMSG     MSGID(CPF0000) /* Just in case it's already +
                          there */

             DSPJRN     JRN(QACGJRN) RCVRNG(*CURCHAIN) +
                          FROMTIME(&DAYTE 000001) JRNCDE((A)) +
                          ENTTYP(SP) OUTPUT(*OUTFILE) +
                          OUTFILFMT(*TYPE1) OUTFILE(QTEMP/T2)

/* If you don't have Sequel from ASC, replace the following          */
/*   statement with a Query/400 query.  You can even use a DSPPFM    */
/*   and scan thru the file.                                         */

             DISPLAY    SQL('SELECT jadfn, jauser, +
                          zoned((SST(jadate,5,2) CAT +
                          SST(jadate,1,4)),6,0) edtcde(Y) +
                          name(dayte) colhdg("Entry" "Date"), +
                          jatime edtwrd("  :  :  "), jatpag, jadevn +
                          FROM qtemp/t2 WHERE jauser= "' || &USER +
                          || '" order by dayte desc, jatime desc')

 ENDIT:      ENDPGM

This was first published in May 2001

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.