cwbOBJ_GetSplFHandleFromNewSplF

Purpose

Uses a new spooled file handle to generate a spooled file handle. See notes below about using this API on a new spool file that was created with data type automatic.

Syntax

 
unsigned int CWB_ENTRY cwbOBJ_GetSplFHandleFromNewSplF(
                              cwbOBJ_ObjHandle    newSplFHandle,
                              cwbOBJ_ObjHandle   *splFHandle,
                              cwbSV_ErrHandle     errorHandle);

Parameters

cwbOBJ_ObjHandle newSplFHandle - input
New spooled file handle. This is the handle passed back on the cwbOBJ_CreateNewSplF() API.
cwbOBJ_ObjHandle *splFHandle - output
Pointer to an object handle that, upon successful completion of this call, will hold the spooled file handle. This handle may be used with other APIs that take a spooled file handle as input.
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 spooled file handle.
CWBOBJ_RC_HOST_ERROR
Host error occurred. Text may be in errorHandle.
CWBOBJ_RC_SPLFNOTOPEN
Spooled file hasn't been created on the host yet.

Usage

The handle returned in splFHandle must be released with the cwbOBJ_DeleteObjHandle() API in order to free resources.

If you are using automatic data typing for the spooled file (the attribute of CWBOBJ_KEY_PRTDEVTYPE was set to *AUTO or or wasn't specified on the cwbOBJ_CreateNewSplF() API) then creation of the spooled file will be delayed until sufficient data has been written to the spooled file to determine the type of the data (*SCS, *AFPDS or *USERASCII). If the new spooled file is in this state when you call this API, the return code will be CWBOBJ_RC_SPLFNOTOPEN.