Description
This method allows other components to insert or update records in the class-table.
Parameters
Internal usage
QadFinancials
program code (program9/bbudgetlinkaccdet.p)
/* ================================================================ */
/* Input tApiBudgetLinkAccDet contains list of Budgets, which */
/* should be calculated. Next it contains BudgetFDS that can be */
/* used for proportional allocation. Next it contains leaf */
/* BudgetWBS topic determining branch of budget */
/* ================================================================ */
/* ============================ */
/* Return if no data is passed */
/* ============================ */
if not can-find (first tApiBudgetLinkAccDet)
then return.
/* =================================== */
/* Set Return-status = Default-error */
/* =================================== */
assign oiReturnStatus = -98.
/* ================== */
/* Empty the instance */
/* ================== */
<M-4 run ClearData (output viFcReturnSuper (oiReturnStatus)) in BBudgetLinkAccDet>
if viFcReturnSuper <> 0
then do :
assign oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0
then return.
end. /* if viFcReturnSuper <> 0 */
/* ================================================================================== */
/* Temp-table tApiBudgetLinkAccDet contains leaf WBS topics. */
/* For every record in this input temp-table: */
/* We have to find the topic of the branch which is used for proportional allocation */
/* ================================================================================== */
for each tApiBudgetLinkAccDet:
/* ========================================================== */
/* Normalise input values: avoid having uinknown values in it */
/* ========================================================== */
if tApiBudgetLinkAccDet.BudgetWBS_ID = ? then assign tApiBudgetLinkAccDet.BudgetWBS_ID = 0.
if tApiBudgetLinkAccDet.Budget_ID = ? then assign tApiBudgetLinkAccDet.Budget_ID = 0.
if tApiBudgetLinkAccDet.Period_ID = ? then assign tApiBudgetLinkAccDet.Period_ID = 0.
if tApiBudgetLinkAccDet.Layer_ID = ? then assign tApiBudgetLinkAccDet.Layer_ID = 0.
if tApiBudgetLinkAccDet.CostCentre_ID = ? then assign tApiBudgetLinkAccDet.CostCentre_ID = 0.
if tApiBudgetLinkAccDet.Division_ID = ? then assign tApiBudgetLinkAccDet.Division_ID = 0.
if tApiBudgetLinkAccDet.Project_ID = ? then assign tApiBudgetLinkAccDet.Project_ID = 0.
if tApiBudgetLinkAccDet.SafConcept_ID = ? then assign tApiBudgetLinkAccDet.SafConcept_ID = 0.
if tApiBudgetLinkAccDet.Saf_ID = ? then assign tApiBudgetLinkAccDet.Saf_ID = 0.
/* ================================================================================= */
/* Cycle as long as we do not have the parent that is marked as the allocation level */
/* ================================================================================= */
assign viBudgetWBSID = tApiBudgetLinkAccDet.BudgetWBS_ID.
do while viBudgetWBSID <> ? and
viBudgetWBSID <> 0 :
/* ======================================== */
/* Find the WBS identified by viBudgetWBSID */
/* ======================================== */
<Q-18 run BudgetWBSByBudgetIDWBSCode (all) (Read) (NoCache)
(input ?, (BudgetID)
input viBudgetWBSID, (BudgetWBSID)
input ?, (BudgetWBSCode)
input ?, (ParentBudgetWBSID)
input ?, (BudgetCode)
input ?, (BudgetStatus)
output dataset tqBudgetWBSByBudgetID) in BBudget>
find first tqBudgetWBSByBudgetID no-lock no-error.
if available tqBudgetWBSByBudgetID
then do:
if tqBudgetWBSByBudgetID.tiBudgetFDS_ID <> tApiBudgetLinkAccDet.tiBudgetFDS_ID
then
/* ======================================================================================================== */
/* Current WBS topic is not the one used for proportional allocation so keep cycling but now for the parent */
/* ======================================================================================================== */
assign viBudgetWBSID = tqBudgetWBSByBudgetID.tiParentBudgetWBS_ID.
else do:
/* ==================================================================================================== */
/* We found out correct ButgetWBS; stop cycling and assign the non-used fields in the input temp-table */
/* ==================================================================================================== */
assign viBudgetWBSID = ?
tApiBudgetLinkAccDet.BudgetWBS_ID = tqBudgetWBSByBudgetID.tiBudgetWBS_ID.
/* ======================================================================= */
/* Remove values of all FDS elements not used by WBS topic */
/* ======================================================================= */
case tApiBudgetLinkAccDet.tcBudgetFDSType:
when {&BUDGETFDSTYPE-DIVISION}
then assign tApiBudgetLinkAccDet.CostCentre_ID = 0
tApiBudgetLinkAccDet.Project_ID = 0
tApiBudgetLinkAccDet.SafConcept_ID = 0
tApiBudgetLinkAccDet.Saf_ID = 0.
when {&BUDGETFDSTYPE-PROJECT}
then assign tApiBudgetLinkAccDet.CostCentre_ID = 0
tApiBudgetLinkAccDet.Division_ID = 0
tApiBudgetLinkAccDet.SafConcept_ID = 0
tApiBudgetLinkAccDet.Saf_ID = 0.
when {&BUDGETFDSTYPE-COSTCENTRE}
then assign tApiBudgetLinkAccDet.Project_ID = 0
tApiBudgetLinkAccDet.Division_ID = 0
tApiBudgetLinkAccDet.SafConcept_ID = 0
tApiBudgetLinkAccDet.Saf_ID = 0.
when {&BUDGETFDSTYPE-SAF}
then do:
assign tApiBudgetLinkAccDet.Project_ID = 0
tApiBudgetLinkAccDet.CostCentre_ID = 0
tApiBudgetLinkAccDet.Division_ID = 0.
case tqBudgetWBSByBudgetID.tiSafConcept_ID:
when tApiBudgetLinkAccDet.tiSafConcept1_ID
then assign vcSafCode = tApiBudgetLinkAccDet.tcSaf1_Code
tApiBudgetLinkAccDet.SafConcept_ID = tApiBudgetLinkAccDet.tiSafConcept1_ID.
when tApiBudgetLinkAccDet.tiSafConcept2_ID
then assign vcSafCode = tApiBudgetLinkAccDet.tcSaf2_Code
tApiBudgetLinkAccDet.SafConcept_ID = tApiBudgetLinkAccDet.tiSafConcept2_ID.
when tApiBudgetLinkAccDet.tiSafConcept3_ID
then assign vcSafCode = tApiBudgetLinkAccDet.tcSaf3_Code
tApiBudgetLinkAccDet.SafConcept_ID = tApiBudgetLinkAccDet.tiSafConcept3_ID.
when tApiBudgetLinkAccDet.tiSafConcept4_ID
then assign vcSafCode = tApiBudgetLinkAccDet.tcSaf4_Code
tApiBudgetLinkAccDet.SafConcept_ID = tApiBudgetLinkAccDet.tiSafConcept4_ID.
when tApiBudgetLinkAccDet.tiSafConcept5_ID
then assign vcSafCode = tApiBudgetLinkAccDet.tcSaf5_Code
tApiBudgetLinkAccDet.SafConcept_ID = tApiBudgetLinkAccDet.tiSafConcept5_ID.
end. /* case tqBudgetWBSByBudgetID.tiSafConcept_ID */
<Q-21 run SafPrim (all) (Read) (NoCache)
(input ?, (SafID)
input vcSafCode, (SafCode)
input ?, (SafConceptCode)
output dataset tqSafPrim) in BSaf>
find first tqSafPrim no-lock no-error.
if available tqSafPrim
then assign tApiBudgetLinkAccDet.Saf_ID = tqSafPrim.tiSaf_ID.
end. /* when {&BUDGETFDSTYPE-SAF} */
end case. /* case tApiBudgetLinkAccDet.tcBudgetFDSType */
end. /* Not if tqBudgetWBSByBudgetID.tiBudgetFDS_ID <> tApiBudgetLinkAccDet.tiBudgetFDS_ID */
end. /* if available tqBudgetWBSByBudgetID */
end. /* do while viBudgetWBSID <> ? and */
end. /* for each tApiBudgetLinkAccDet: */
/* =================================================================== */
/* Create list of existing records in DB that will be Loaded later on */
/* and create new instance records for the others (the not existing) */
/* =================================================================== */
assign vcListInstanceIDsToLoad = "":U.
for each tApiBudgetLinkAccDet:
/* Check the instance-data */
find first tBudgetLinkAccDet where
(tBudgetLinkAccDet.BudgetWBS_ID = tApiBudgetLinkAccDet.BudgetWBS_ID or
(tBudgetLinkAccDet.BudgetWBS_ID = ? and tApiBudgetLinkAccDet.BudgetWBS_ID = 0)) and
(tBudgetLinkAccDet.Budget_ID = tApiBudgetLinkAccDet.Budget_ID or
(tBudgetLinkAccDet.Budget_ID = ? and tApiBudgetLinkAccDet.Budget_ID = 0)) and
(tBudgetLinkAccDet.Period_ID = tApiBudgetLinkAccDet.Period_ID or
(tBudgetLinkAccDet.Period_ID = ? and tApiBudgetLinkAccDet.Period_ID = 0)) and
(tBudgetLinkAccDet.Layer_ID = tApiBudgetLinkAccDet.Layer_ID or
(tBudgetLinkAccDet.Layer_ID = ? and tApiBudgetLinkAccDet.Layer_ID = 0)) and
(tBudgetLinkAccDet.CostCentre_ID = tApiBudgetLinkAccDet.CostCentre_ID or
(tBudgetLinkAccDet.CostCentre_ID = ? and tApiBudgetLinkAccDet.CostCentre_ID = 0)) and
(tBudgetLinkAccDet.Division_ID = tApiBudgetLinkAccDet.Division_ID or
(tBudgetLinkAccDet.Division_ID = ? and tApiBudgetLinkAccDet.Division_ID = 0)) and
(tBudgetLinkAccDet.Project_ID = tApiBudgetLinkAccDet.Project_ID or
(tBudgetLinkAccDet.Project_ID = ? and tApiBudgetLinkAccDet.Project_ID = 0)) and
(tBudgetLinkAccDet.SafConcept_ID = tApiBudgetLinkAccDet.SafConcept_ID or
(tBudgetLinkAccDet.SafConcept_ID = ? and tApiBudgetLinkAccDet.SafConcept_ID = 0)) and
(tBudgetLinkAccDet.Saf_ID = tApiBudgetLinkAccDet.Saf_ID or
(tBudgetLinkAccDet.Saf_ID = ? and tApiBudgetLinkAccDet.Saf_ID = 0))
no-lock no-error.
if not available tBudgetLinkAccDet
then do:
/* Try to find existing record */
<Q-25 run BudgetLinkAccDetByWBSPeriod (all) (Read) (NoCache)
(input tApiBudgetLinkAccDet.Period_ID, (Period_ID)
input tApiBudgetLinkAccDet.BudgetWBS_ID, (BudgetWBS_ID)
input tApiBudgetLinkAccDet.CostCentre_ID, (CostCentre_ID)
input tApiBudgetLinkAccDet.Division_ID, (Division_ID)
input tApiBudgetLinkAccDet.Project_ID, (Project_ID)
input tApiBudgetLinkAccDet.SafConcept_ID, (SafConcept_ID)
input tApiBudgetLinkAccDet.Saf_ID, (Saf_ID)
input tApiBudgetLinkAccDet.Budget_ID, (Budget_ID)
input ?, (CompanyId)
input ?, (PeriodYearPeriodFrom)
input ?, (PeriodYearPeriodTill)
input string(tApiBudgetLinkAccDet.Layer_ID), (Layer_ID_List)
output dataset tqBudgetLinkAccDetByWBSPeriod) in BBudgetLinkAccDet>
find first tqBudgetLinkAccDetByWBSPeriod where
(tqBudgetLinkAccDetByWBSPeriod.tiBudgetWBS_ID = tApiBudgetLinkAccDet.BudgetWBS_ID or
(tqBudgetLinkAccDetByWBSPeriod.tiBudgetWBS_ID = ? and tApiBudgetLinkAccDet.BudgetWBS_ID = 0)) and
(tqBudgetLinkAccDetByWBSPeriod.tiBudget_ID = tApiBudgetLinkAccDet.Budget_ID or
(tqBudgetLinkAccDetByWBSPeriod.tiBudget_ID = ? and tApiBudgetLinkAccDet.Budget_ID = 0)) and
(tqBudgetLinkAccDetByWBSPeriod.tiPeriod_ID = tApiBudgetLinkAccDet.Period_ID or
(tqBudgetLinkAccDetByWBSPeriod.tiPeriod_ID = ? and tApiBudgetLinkAccDet.Period_ID = 0)) and
(tqBudgetLinkAccDetByWBSPeriod.tiLayer_ID = tApiBudgetLinkAccDet.Layer_ID or
(tqBudgetLinkAccDetByWBSPeriod.tiLayer_ID = ? and tApiBudgetLinkAccDet.Layer_ID = 0)) and
(tqBudgetLinkAccDetByWBSPeriod.tiCostCentre_ID = tApiBudgetLinkAccDet.CostCentre_ID or
(tqBudgetLinkAccDetByWBSPeriod.tiCostCentre_ID = ? and tApiBudgetLinkAccDet.CostCentre_ID = 0)) and
(tqBudgetLinkAccDetByWBSPeriod.tiDivision_ID = tApiBudgetLinkAccDet.Division_ID or
(tqBudgetLinkAccDetByWBSPeriod.tiDivision_ID = ? and tApiBudgetLinkAccDet.Division_ID = 0)) and
(tqBudgetLinkAccDetByWBSPeriod.tiProject_ID = tApiBudgetLinkAccDet.Project_ID or
(tqBudgetLinkAccDetByWBSPeriod.tiProject_ID = ? and tApiBudgetLinkAccDet.Project_ID = 0)) and
(tqBudgetLinkAccDetByWBSPeriod.tiSafConcept_ID = tApiBudgetLinkAccDet.SafConcept_ID or
(tqBudgetLinkAccDetByWBSPeriod.tiSafConcept_ID = ? and tApiBudgetLinkAccDet.SafConcept_ID = 0)) and
(tqBudgetLinkAccDetByWBSPeriod.tiSaf_ID = tApiBudgetLinkAccDet.Saf_ID or
(tqBudgetLinkAccDetByWBSPeriod.tiSaf_ID = ? and tApiBudgetLinkAccDet.Saf_ID = 0))
no-lock no-error.
if not available tqBudgetLinkAccDetByWBSPeriod
then do :
/* Create a new one */
<M-26 run AddDetailLine
(input 'BudgetLinkAccDet':U (icTable),
input '':U (icParentRowid),
output viFcReturnSuper (oiReturnStatus)) in BBudgetLinkAccDet>
assign tBudgetLinkAccDet.BudgetWBS_ID = tApiBudgetLinkAccDet.BudgetWBS_ID
tBudgetLinkAccDet.Budget_ID = tApiBudgetLinkAccDet.Budget_ID
tBudgetLinkAccDet.Period_ID = tApiBudgetLinkAccDet.Period_ID
tBudgetLinkAccDet.Layer_ID = tApiBudgetLinkAccDet.Layer_ID
tBudgetLinkAccDet.CostCentre_ID = tApiBudgetLinkAccDet.CostCentre_ID
tBudgetLinkAccDet.Division_ID = tApiBudgetLinkAccDet.Division_ID
tBudgetLinkAccDet.Project_ID = tApiBudgetLinkAccDet.Project_ID
tBudgetLinkAccDet.SafConcept_ID = tApiBudgetLinkAccDet.SafConcept_ID
tBudgetLinkAccDet.Saf_ID = tApiBudgetLinkAccDet.Saf_ID.
end. /* if not available tqBudgetLinkAccDetByWBSPeriod */
else do:
if vcListInstanceIDsToLoad = "":U
then vcListInstanceIDsToLoad = string(tqBudgetLinkAccDetByWBSPeriod.tiBudgetLinkAccDet_ID).
else if lookup(string(tqBudgetLinkAccDetByWBSPeriod.tiBudgetLinkAccDet_ID),vcListInstanceIDsToLoad,chr(4)) = 0
then vcListInstanceIDsToLoad = vcListInstanceIDsToLoad + chr(4) + string (tqBudgetLinkAccDetByWBSPeriod.tiBudgetLinkAccDet_ID).
end. /* Not if not available tqBudgetLinkAccDetByWBSPeriod */
end. /* if not available tBudgetLinkAccDet */
end. /* for each tApiBudgetLinkAccDet: */
/* ================================= */
/* DataLoad for the existing records */
/* ================================= */
if vcListInstanceIDsToLoad <> "":U
then do:
<M-28 run DataLoad
(input '':U (icRowids),
input vcListInstanceIDsToLoad (icPkeys),
input '':U (icObjectIds),
input '':U (icFreeform),
input yes (ilKeepPrevious),
output viFcReturnSuper (oiReturnStatus)) in BBudgetLinkAccDet>
if viFcReturnSuper <> 0
then assign oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0
then return.
end. /* if vcListInstanceIDsToLoad <> "":U */
/* ======================================= */
/* Update the actual-values of the records */
/* ======================================= */
for each tApiBudgetLinkAccDet:
find first tBudgetLinkAccDet where
(tBudgetLinkAccDet.BudgetWBS_ID = tApiBudgetLinkAccDet.BudgetWBS_ID or
(tBudgetLinkAccDet.BudgetWBS_ID = ? and tApiBudgetLinkAccDet.BudgetWBS_ID = 0)) and
(tBudgetLinkAccDet.Budget_ID = tApiBudgetLinkAccDet.Budget_ID or
(tBudgetLinkAccDet.Budget_ID = ? and tApiBudgetLinkAccDet.Budget_ID = 0)) and
(tBudgetLinkAccDet.Period_ID = tApiBudgetLinkAccDet.Period_ID or
(tBudgetLinkAccDet.Period_ID = ? and tApiBudgetLinkAccDet.Period_ID = 0)) and
(tBudgetLinkAccDet.Layer_ID = tApiBudgetLinkAccDet.Layer_ID or
(tBudgetLinkAccDet.Layer_ID = ? and tApiBudgetLinkAccDet.Layer_ID = 0)) and
(tBudgetLinkAccDet.CostCentre_ID = tApiBudgetLinkAccDet.CostCentre_ID or
(tBudgetLinkAccDet.CostCentre_ID = ? and tApiBudgetLinkAccDet.CostCentre_ID = 0)) and
(tBudgetLinkAccDet.Division_ID = tApiBudgetLinkAccDet.Division_ID or
(tBudgetLinkAccDet.Division_ID = ? and tApiBudgetLinkAccDet.Division_ID = 0)) and
(tBudgetLinkAccDet.Project_ID = tApiBudgetLinkAccDet.Project_ID or
(tBudgetLinkAccDet.Project_ID = ? and tApiBudgetLinkAccDet.Project_ID = 0)) and
(tBudgetLinkAccDet.SafConcept_ID = tApiBudgetLinkAccDet.SafConcept_ID or
(tBudgetLinkAccDet.SafConcept_ID = ? and tApiBudgetLinkAccDet.SafConcept_ID = 0)) and
(tBudgetLinkAccDet.Saf_ID = tApiBudgetLinkAccDet.Saf_ID or
(tBudgetLinkAccDet.Saf_ID = ? and tApiBudgetLinkAccDet.Saf_ID = 0))
no-lock no-error.
if not available tBudgetLinkAccDet
then do:
assign oiReturnStatus = -3
vcMessage = trim(substitute(#T-31'Internal error: the budget - accounting link detail could not be loaded although the record could be found in the database based on its ID (&1).':200(15787)T-31#,string(tqBudgetLinkAccDetByWBSPeriod.tiBudgetLinkAccDet_ID))).
<M-30 run SetMessage (input vcMessage (icMessage),
input '':U (icArguments),
input '':U (icFieldName),
input '':U (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input '':U (icRowid),
input 'QADFIN-3796':U (icFcMsgNumber),
input '':U (icFcExplanation),
input '':U (icFcIdentification),
input '':U (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BBudgetLinkAccDet>
return.
end. /* if not available tBudgetLinkAccDet */
assign tBudgetLinkAccDet.BudgetLinkAccDetDebitLC = tBudgetLinkAccDet.BudgetLinkAccDetDebitLC
+ (if tApiBudgetLinkAccDet.BudgetLinkAccDetDebitLC = ?
then 0
else tApiBudgetLinkAccDet.BudgetLinkAccDetDebitLC)
tBudgetLinkAccDet.BudgetLinkAccDetCreditLC = tBudgetLinkAccDet.BudgetLinkAccDetCreditLC
+ (if tApiBudgetLinkAccDet.BudgetLinkAccDetCreditLC = ?
then 0
else tApiBudgetLinkAccDet.BudgetLinkAccDetCreditLC)
tBudgetLinkAccDet.BudgetLinkAccDetQTY = tBudgetLinkAccDet.BudgetLinkAccDetQTY
+ (if tApiBudgetLinkAccDet.BudgetLinkAccDetQTY = ?
then 0
else tApiBudgetLinkAccDet.BudgetLinkAccDetQTY).
assign tBudgetLinkAccDet.tc_Status = if tBudgetLinkAccDet.tc_Status = '':U
then 'C':U
else tBudgetLinkAccDet.tc_Status.
end. /* or each tApiBudgetLinkAccDet: */
/* ================================================================ */
/* Perfom Validation, AdditionalUpdates and DataSave */
/* ================================================================ */
<M-7 run ValidateBC (output viFcReturnSuper (oiReturnStatus)) in BBudgetLinkAccDet>
if viFcReturnSuper <> 0
then do :
assign oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0
then return.
end. /* if viFcReturnSuper <> 0 */
<M-8 run AdditionalUpdates (output viFcReturnSuper (oiReturnStatus)) in BBudgetLinkAccDet>
if viFcReturnSuper <> 0
then do :
assign oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0
then return.
end. /* if viFcReturnSuper <> 0 */
<M-9 run DataSave (output viFcReturnSuper (oiReturnStatus)) in BBudgetLinkAccDet>
if viFcReturnSuper <> 0
then do :
assign oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0
then return.
end. /* if viFcReturnSuper <> 0 */
/* ================================================================ */
/* Set Return-status = OK */
/* ================================================================ */
if oiReturnStatus = -98
then assign oiReturnStatus = 0.
Sample code: how to call this method through RPCRequestService (QXtend Inbound)
define temp-table ttContext no-undo
field propertyQualifier as character
field propertyName as character
field propertyValue as character
index entityContext is primary unique
propertyQualifier
propertyName
index propertyQualifier
propertyQualifier.
define dataset dsContext for ttContext.
define variable vhContextDS as handle no-undo.
define variable vhExceptionDS as handle no-undo.
define variable vhServer as handle no-undo.
define variable vhInputDS as handle no-undo.
define variable vhInputOutputDS as handle no-undo.
define variable vhOutputDS as handle no-undo.
define variable vhParameter as handle no-undo.
/* Create context */
create ttContext.
assign ttContext.propertyName = "programName"
ttContext.propertyValue = "BBudgetLinkAccDet".
create ttContext.
assign ttContext.propertyName = "methodName"
ttContext.propertyValue = "ApiCreateOrUpdateBudgetLinkAccDet".
create ttContext.
assign ttContext.propertyName = "applicationId"
ttContext.propertyValue = "fin".
create ttContext.
assign ttContext.propertyName = "entity"
ttContext.propertyValue = "1000".
create ttContext.
assign ttContext.propertyName = "userName"
ttContext.propertyValue = "mfg".
create ttContext.
assign ttContext.propertyName = "password"
ttContext.propertyValue = "".
/* Create input dataset */
create dataset vhInputDS.
vhInputDS:read-xmlschema("file", "xml/bbudgetlinkaccdet.apicreateorupdatebudgetlinkaccdet.i.xsd", ?).
vhParameter = vhInputDS:get-buffer-handle("tApiBudgetLinkAccDet").
vhParameter:buffer-create().
assign vhParameter::<field-name-1> = <field-value-1>
vhParameter::<field-name-2> = <field-value-2>
...
/* Connect the AppServer */
create server vhServer.
vhServer:connect("-URL <appserver-url>").
if not vhServer:connected()
then do:
message "Could not connect AppServer" view-as alert-box error title "Error".
return.
end.
/* Run */
assign vhContextDS = dataset dsContext:handle.
run program/rpcrequestservice.p on vhServer
(input-output dataset-handle vhContextDS by-reference,
output dataset-handle vhExceptionDS,
input dataset-handle vhInputDS by-reference,
input-output dataset-handle vhInputOutputDS by-reference,
output dataset-handle vhOutputDS).
/* Handle output however you want, in this example, we dump it to xml */
if valid-handle(vhExceptionDS)
then vhExceptionDS:write-xml("file", "Exceptions.xml", true).
if valid-handle(vhOutputDS)
then vhOutputDS:write-xml("file", "Output.xml", true).
/* Cleanup */
vhServer:disconnect().
assign vhServer = ?.
if valid-handle(vhInputDS)
then delete object vhInputDS.
if valid-handle(vhOutputDS)
then delete object vhOutputDS.
if valid-handle(vhExceptionDS)
then delete object vhExceptionDS.