WINPRINT-SET-JOB-STATUS

This operation code allows you to modify the current status of a print job.

Note: Due to a limitation in the Windows API, computers that run Windows 9x (Windows 98, and Windows ME) do not return the spooler job ID when opening a print job. This means that you cannot use the WINPRINT-SET-JOB-STATUS operation on these machines.

Usage

CALL "WIN$PRINTER"
    USING WINPRINT-SET-JOB-STATUS, WINPRINT-JOB-STATUS
    GIVING RESULT

Parameters

WINPRINT-JOB-STATUS Group item defined in winprint.def as follows:
01  WINPRINT-JOB-STATUS.
   03  WINPRINT-JOB-PRINTER            PIC X(80).
   03  WINPRINT-JOB-ID                 SIGNED-INT.
   03  WINPRINT-JOB-STATUS-NO          PIC 9(9) COMP-5.
      88 WPRT-JOB-PAUSE                VALUE 1.
      88 WPRT-JOB-RESUME               VALUE 2.
      88 WPRT-JOB-CANCEL               VALUE 3.
      88 WPRT-JOB-RESTART              VALUE 4.
   03  WINPRINT-JOB-POSITION           SIGNED-INT.
   03  WINPRINT-JOB-PAGE-TOTAL         SIGNED-INT.
   03  WINPRINT-JOB-PAGE-PRINTED       SIGNED-INT.
   03  WINPRINT-JOB-STATUS-TEXT        PIC X(80).

Return Values

This operation returns the printer status as defined in the Windows API.

A great variety of conditions can affect a single print job and printer status may be the result of a combination of values. This makes it impossible to catalog all possible status settings in winprint.def. Refer to the Windows API documentation for a description of any status not covered in that file.

Description

This operation may not be called while the printer is open. WINPRINT-JOB-STATUS should be initialized prior to use.

Note: If this function is executed on a networked printer with a missing or malfunctioning network, your application may appear to hang. Once the timeout has completed, your application will resume. This is a feature of the Windows API, not an effect of the runtime.

WINPRINT-GET-JOB-STATUS has the following values:

WINPRINT-JOB-PRINTER Should be set to the value of WINPRINT-NAME as obtained through a call to WINPRINT-GET-PRINTER-INFO(-EX) or WINPRINT-GET-CURRENT-INFO(-EX).
WINPRINT-JOB-ID Specifies the print job to be modified. You must get the job ID number with WINPRINT-GET-JOB-STATUS, before you can set this value. If set to 0, the runtime will automatically look up the most recent print job. If a job is currently printing, that is the job that will be modified.
WINPRINT-JOB-STATUS-NO Modify the current print job by setting one of the following values: WPRT-JOB-PAUSE, WPRT-JOB-RESUME, WPRT-JOB-CANCEL, or WPRT-JOB-RESTART.
WINPRINT-JOB-PAGE-TOTAL Specifies the total number of pages to print.
WINPRINT-JOB-STATUS-TEXT Specifies the status of the printer as a text string. Depending on the error condition, this string may be empty. This is a feature of the Windows API. Use both this parameter and WINPRINT-JOB-STATUS-NO when checking job status to be sure that you have determined the correct error condition.