Command to track how many spool files users have

175 pts.
Tags:
AS/400 Spool Files
CLLE
iSeries Commands
RPG
RPG ILE
RPG IV
RPGLE
Spool files
V5R4
I have certain users who never clean out their spool files. Is there any command I can run which will tell me how many spool files a user has out there? I am currently on version V5R4 of the operating system

Software/Hardware used:
v5r4
ASKED: September 27, 2010  3:20 PM
UPDATED: September 29, 2010  12:15 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

One way to do this is to do do WRKSPLF &User output(*PRINT)
Then do a CPYSPLF to a disk file
Look at the data and determine how you want to use it. It may be as simple as get the record count of the file and subtract n (which would be determined my the number of records for page headings).

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

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
  • TomLiotta
    Is there any command I can run which will tell me how many spool files a user has out there? No, not unless you have created one. For most systems, that would be fairly easy. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    An example program to retrieve the count of spooled files for a user:
    pgm    ( +
             &pUser       +
           )
    
       dcl   &pUser       *char   10
    
    
       dcl   &User        *char   10
       dcl   &QOutQ       *char   20     value( '*ALL' )
       dcl   &Form        *char   10     value( '*ALL' )
       dcl   &UsrDta      *char   10     value( '*ALL' )
    
       dcl   &UsrSpc      *char   10     value( SLTSPLF )
       dcl   &UsrSpcLib   *char   10     value( QTEMP )
    
       dcl   &QUsrSpc     *char   20
       dcl   &us_hdr      *char  150
    
       dcl   &nbrlste     *dec  (  9 0 )
       dcl   &cNbrSplf    *char    6
    
    
       chgvar    &User            &pUser
       monmsg  ( mch3601 )  exec( do )
          rcvmsg      msgtype( *LAST ) rmv( *YES )
          monmsg    ( cpf0000 cpf9999 mch0000 )
          chgvar &User            '*CURRENT'
       enddo
    
    
       chgvar    &QUsrSpc       ( &UsrSpc *cat &UsrSpcLib )
    
    /* Create a user space... */
       call        QUSCRTUS     ( +
                                  &QUsrSpc     +
                                  'SPLFLST   ' +
                                  x'00001000'  +
                                  X'00'        +
                                  '*ALL      ' +
                                  'Temp list splfs        ' +
                                  '*YES      ' +
                                  x'00000000'  +
                                )
    
    
    /* List user's spooled files into the space... */
       call        QUSLSPL      ( +
                                  &QUsrSpc     +
                                  'SPLF0100'   +
                                  &User        +
                                  &QOutQ       +
                                  &Form        +
                                  &UsrDta      +
                                )
    
    
    /* Retrieve the number of list entries from the space... */
       call        QUSRTVUS     ( +
                                  &QUsrSpc     +
                                  x'00000001'  +
                                  x'00000096'  +
                                  &us_hdr      +
                                )
    
    /* A full space header was retrieved, but we only need this... */
       chgvar     &nbrlste       %bin( &us_hdr    133 4 )
    
    
       if ( &nbrlste *eq 0 )  do
          sndpgmmsg  msgid( CPF9898 ) msgf( QSYS/QCPFMSG ) +
                       msgdta( 'No spooled files found' )
       enddo
       else  do
          chgvar  &cNbrSplf          ( &nbrlste )
          sndpgmmsg  msgid( CPF9898 ) msgf( QSYS/QCPFMSG ) +
                       msgdta( &User *bcat 'has' *bcat &cNbrSplf *bcat +
                               'spooled files' )
       enddo
    
    
    Clean_up:
    
       dltusrspc  &UsrSpcLib/&UsrSpc
    
    
       return
    
    endpgm
    Call it with a user profile name as a parm. If no parm is supplied, the program will default to '*CURRENT'. Test it, modify it, do whatever you wish. Wrap it in a *CMD and set a return parm instead of a message. If you need info on the APIs, just search on their names in the Information Center. Tom
    125,585 pointsBadges:
    report

Forgot Password

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

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

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

Thanks! We'll email you when relevant content is added and updated.

Following