When you write a Source Format Exit routine for Optim, you specify the exit function, PSTColMapAgeSrcExit (PSTColMapAgeSrcWExit), and the following parameters:
PSTColMapAgeSrcExit
(PST_STRUCT_CM_AGE_SRCFMT_PARM * pInputParms,
PST_STRUCT_CM_EXIT_COL_LIST * pSrcColList,
PST_STRUCT_CM_EXIT_COL_LIST * pDstColList)
PSTColMapAgeSrcWExit
(PST_STRUCT_CM_AGE_SRCFMT_WPARM *
pInputParms,
PST_STRUCT_CM_WEXIT_COL_LIST * pSrcColList,
PST_STRUCT_CM_WEXIT_COL_LIST * pDstColList)
When an Optim process calls a source format exit routine, the process passes the following parameters:
The first field in this structure is the FuncCode field identified by either PST_CM_SRCFMT_TRANSFORM (PST_CMW_SRCFMT_TRANSFORM) or PST_CM_SRCFMT_TERMINATE (PST_CMW_SRCFMT_TERMINATE).
Each time an Optim process calls a source format exit routine, the process passes the address of the following call-back function:
Typical processing for the Source Format Exit routine is summarized in the following steps:
There are several ways that the Source Format Exit routine can abort processing:
The exit routine passes a return code indicating which date format or which abort mode to use.
During a process, the exit routine may interrogate any columns from the input row and some of the columns from the destination row. However, the exit routine cannot interrogate a destination column that includes an exit routine and is defined in the Column Map after the current destination column. All other destination columns are available.
The following return codes apply to source format exits:
PST_CM_SRCFMT_USE_TIMESTAMP
(PST_CMW_SRCFMT_USE_TIMESTAMP)
Destination column is assigned a value in the OutputTimeStamp field of the first parameter passed to the exit.
PST_CM_SRCFMT_USE_SYB_DATETIME
(PST_CMW_SRCFMT_USE_SYB_DATETIME)
Destination column is assigned a value in the OutputSybDateTime field of the first parameter passed to the exit.
PST_CM_SRCFMT_SKIP
(PST_CMW_SRCFMT_SKIP)
Aging is not applied. If you do not select the option to Process rows with skipped dates, the row is rejected. Otherwise, the data is copied to the source, as long as the source and destination are compatible. If not compatible, the row is rejected.
PST_CM_SRCFMT_COL_INVALID
(PST_CMW_SRCFMT_COL_INVALID)
Aging is not applied. If you do not select the option to Process rows with invalid dates, the row is rejected. Otherwise, the data is copied to the source, as long as the source and destination are compatible. If not compatible, the row is rejected.
PST_CM_SRCFMT_REJECT_ROW
(PST_CMW_SRCFMT_REJECT_ROW)
Source column cannot be assigned a value. Reject (discard) the row.
PST_CM_SRCFMT_ABORT_PROCESS
(PST_CMW_SRCFMT_ABORT_PROCESS)
Fatal error. Terminate. To return an error message, place the message in the work area and set the unused space to blanks or NULL.