Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

OPEN-VIRTUAL-DEVICE-DIALOG

&pagelevel(3)&pagelevel

Open dialog with virtual printer

Component:

SPOOL

Functional area:

Controlling spoolout job

Domain:

SPOOL-PRINT-SERVICES

Privileges:

STD-PROCESSING
PRINT-SERVICE-ADMINISTRATION

Function

The OPEN-VIRTUAL-DEVICE-DIALOG command initializes the dialog between a virtual device and the user application procedure in which the call takes place. It is executed in batch mode only.

The command is part of a set of four commands which enable an application to be created in the form of an S procedure (see "Sample application procedure"). These commands manage the dialog between a virtual device and the application which was started in batch mode as an S procedure:

  • OPEN-VIRTUAL-DEVICE-DIALOG

  • GET-JOB-FROM-VIRTUAL-DEVICE

  • RETURN-JOB-TO-VIRTUAL-DEVICE

  • CLOSE-VIRTUAL-DEVICE-DIALOG

Format

OPEN-VIRTUAL-DEVICE-DIALOG                                                                                                              


Return codes

(SC2)

SC1

Maincode

Meaning


0

CMD0001

No error; command successfully processed


32

SCP0974

Unexpected command

5

32

SCP0974

Memory request error

Notes

  1. This dialog with the virtual device need be initialized only once, at the beginning of the procedure.

  2. If the dialog cannot be initialized, the command is rejected and a return code is set.

  3. If initialization has already taken place, the command is rejected and a return code is set.

  4. This command can only be used in batch mode.

  5. Spin-off processing is activated each time an error is detected. 

Sample application procedure

/SET-PROC-OPTIONS DATA-ESCAPE-CHAR=*STD,LOGGING-ALLOWED=*YES
/ " *************************************************************** "
/ " * PARAMETERS DECLARATION                                      * "
/ " *************************************************************** "
/BEGIN-PARAMETER-DECLARATION
/END-PARAMETER-DECLARATION
/ " *************************************************************** "
/ " * END PARAMETERS DECLARATION                                  * "
/ " *************************************************************** "
/MODIFY-PROC-TEST-OPTIONS LOGGING=*PARAMETERS(CMD=*YES,DATA=*YES)
/MODIFY-JOB-OPTIONS LOGGING=*PARAMETERS(LISTING=*YES,/
                            HARDCOPY=*YES)
/MOD-TERMINAL-OPTION OVERFLOW-CONTROL=NO-CONTROL
/STEP
/DECL-VAR VAR-NA=JOB-ID,TYP=*STRING,SCOPE=*TASK
/DECL-VAR TSN,TYP=*STRING
/DECL-VAR ACTION(TYP=*STRING,INIT-VAL='*INIT')
/DECL-VAR CONDITION,TYP=*BOOLEAN
/DECL-VAR ERROR-LIST(INIT='(0,0,CMD0001)',TYP=*STRING)
/STEP
/OPEN-VIRTUAL-DEVICE-DIALOG
/ IF-CMD-ERROR
/ END-IF
/STEP
/WHILE CONDITION=(ACTION<>'*LAST')
/STEP
/GET-JOB-FROM-VIRTUAL-DEVICE FILE-PREFIX=*NONE, -
/                            METADAT-PREFIX=*NONE, -
/                            OUTPUT-DOC-ID=JOB-ID
/ IF-CMD-ERROR
/    ERROR-LIST='(&SUBCODE1,&SUBCODE2,&MAINCODE)'
/    SH-VAR ERROR-LIST
/ END-IF
/STEP
/IF ('&(SUBSTRING(JOB-ID,1,5))' == '*NONE')
/CLOSE-VIRTUAL-DEVICE-DIALOG
/ IF-CMD-ERROR
/    ERROR-LIST='(&SUBCODE1,&SUBCODE2,&MAINCODE)'
/    SH-VAR ERROR-LIST
/ END-IF
/EXIT-PROC
/END-IF
/STEP
/TSN=SUBSTRING(JOB-ID,1,4)
/STEP
  .
  .
     User-specific procedure part
  .
  .
/RETURN-JOB-TO-VIRTUAL-DEVICE POST-ACTION=*WAIT
/END-WHILE