cwbOBJ_StartWriter

Purpose

Starts an iSeries™ writer job.

Syntax

 
unsigned int CWB_ENTRY  cwbOBJ_StartWriter(
                               cwbOBJ_ObjHandle   *printerHandle,
                               cwbOBJ_ObjHandle   *outputQueueHandle,
                               cwbOBJ_ParmHandle  *parmListHandle,
                               cwbOBJ_ObjHandle   *writerHandle,
                               cwbSV_ErrHandle     errorHandle);

Parameters

cwbOBJ_ObjHandle *printerHandle - input
Required. A pointer to a valid printer object handle that identifies which printer this writer is to be started to.
cwbOBJ_ObjHandle *outputQueueHandle - input
Optional. A pointer to a valid output queue object handle that identifies which output queue this writer is to be started from. If the parmListHandle is also specified and contains the CWBOBJ_KEY_OUTQUE parameter key, this parameter is ignored.
cwbOBJ_ParmHandle *parmListHandle - input
Optional. A pointer to a valid parameter list object handle that contains parameters for starting the writer.
cwbOBJ_ObjHandle *writerHandle - output
Optional. A pointer to a writer object handle that will be filled in upon successful return from this API. If this parameter is specified, the caller must call cwbOBJ_DeleteObjHandle() to release resources allocated for this writer handle.
cwbSV_ErrHandle errorHandle - output
Optional, may be 0. Any returned messages will be written to this object. It is created with the cwbSV_CreateErrHandle() API. The messages may be retrieved through the cwbSV_GetErrText() API. If the parameter is set to zero, no messages will be retrievable.

Return Codes

The following list shows common return values.

CWB_NO_ERROR
Successful completion.
CWB_NOT_ENOUGH_MEMORY
Insufficient memory.
CWB_INVALID_HANDLE
Handle is not valid.
CWB_INVALID_PARAMETER
Invalid parameter specified.
CWBOBJ_RC_HOST_ERROR
Host error occurred. Text may be in errorHandle.

Usage

Calling this API causes the writer job to be submitted to run. The writer job may fail to start even though this API returns successfully (the job may be successfully submitted, but fail to start). This is the behavior of the STRPRTWTR command on the iSeries server. The following parameter keys may be set in the parmListHandle object:
CWBOBJ_KEY_ALIGN       - Align page
CWBOBJ_KEY_ALWDRTPRT   - Allow direct printing
CWBOBJ_KEY_AUTOEND     - Automatically end writer (*YES,*NO)
CWBOBJ_KEY_DRWRSEP     - Drawer to use for separators
CWBOBJ_KEY_FILESEP     - Number of file separators
CWBOBJ_KEY_FORMTYPE    - Name of the form to be used
CWBOBJ_KEY_JOBNAME     - Name of the job that created file
CWBOBJ_KEY_JOBNUMBER   - Number of the job that created file
CWBOBJ_KEY_USER        - Name of the user that created file
CWBOBJ_KEY_FORMTYPEMSG - Form type message option
CWBOBJ_KEY_MSGQUELIB   - Message queue library
CWBOBJ_KEY_MSGQUE      - Message queue name
CWBOBJ_KEY_OUTQUELIB   - Output queue library
CWBOBJ_KEY_OUTQUE      - Output queue
CWBOBJ_KEY_SPOOLFILE   - Spool file name
CWBOBJ_KEY_SPLFNUM     - Spool file number
CWBOBJ_KEY_WTRSTRPAGE  - Page to start the writer on
CWBOBJ_KEY_WTREND      - When to end the writer
CWBOBJ_KEY_WRITER      - Writer job name
CWBOBJ_KEY_WTRINIT     - When to initialize the printer device