Remote printer - spool file status - IBM AS400

This is a discussion on Remote printer - spool file status - IBM AS400 ; Remote printer status I wrote a CL program to get the status of the spool file(one page per/ every spool file) in REMOTE PRINTER (to make sure whether the spool file is printed or not). I used API's to determine ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Remote printer - spool file status

  1. Remote printer - spool file status

    Remote printer status

    I wrote a CL program to get the status of the spool file(one page per/
    every spool file) in REMOTE PRINTER (to make sure whether the spool
    file is printed or not).

    I used API's to determine this.
    1. Writer started or not(&WTRSTR) - QGYRPRTA
    2. Writer Job status(&WTRJSTS) - QSPROUTQ
    3. Spool file status (&SPLSTS) - QUSRSPLA

    IF COND((&WTRSTR *EQ '1') *AND (&WTRJSTS *EQ 'STR') +
    *AND ((&SPLSTS *EQ *SAVED) *OR (&SPLSTS *EQ *WRITING) +
    *OR (&SPLSTS *EQ *SENDING) *OR (&SPLSTS *EQ *READY))) +
    THEN(DO)
    CHGVAR VAR(&RTNSTS) VALUE('OK')
    ELSE DO
    CHGVAR VAR(&RTNSTS) VALUE('ER')
    ENDDO

    If any of above 3 condition fails abort the program from further
    printing.
    Program works fine in case of single spool file print. But if the
    program generates more then one spool file it returns failure in
    (&SPLSTS). (I think this is because 2nd or 3rd spool file may wait
    for the 1st or 2nd spool to get printed).

    Should I do a delay job before every print.

    Any suggestions please. Thank your for your kindness.

    Regards,
    Gai.


  2. Re: Remote printer - spool file status

    gai wrote:
    > Remote printer status
    >
    > I wrote a CL program to get the status of the spool file(one page per/
    > every spool file) in REMOTE PRINTER (to make sure whether the spool
    > file is printed or not).
    >
    > I used API's to determine this.
    > 1. Writer started or not(&WTRSTR) - QGYRPRTA
    > 2. Writer Job status(&WTRJSTS) - QSPROUTQ
    > 3. Spool file status (&SPLSTS) - QUSRSPLA


    Gai:

    Please show the parameters used for QUSRSPLA. Also, please show any
    error messages related to the failure. I would first suspect that the
    parameter for 'Spooled file number' may need attention.

    Tom

    > IF COND((&WTRSTR *EQ '1') *AND (&WTRJSTS *EQ 'STR') +
    > *AND ((&SPLSTS *EQ *SAVED) *OR (&SPLSTS *EQ *WRITING) +
    > *OR (&SPLSTS *EQ *SENDING) *OR (&SPLSTS *EQ *READY))) +
    > THEN(DO)
    > CHGVAR VAR(&RTNSTS) VALUE('OK')
    > ELSE DO
    > CHGVAR VAR(&RTNSTS) VALUE('ER')
    > ENDDO
    >
    > If any of above 3 condition fails abort the program from further
    > printing.
    > Program works fine in case of single spool file print. But if the
    > program generates more then one spool file it returns failure in
    > (&SPLSTS). (I think this is because 2nd or 3rd spool file may wait
    > for the 1st or 2nd spool to get printed).
    >
    > Should I do a delay job before every print.
    >
    > Any suggestions please. Thank your for your kindness.


    --
    Tom Liotta
    http://zap.to/tl400

+ Reply to Thread