BUSINESS SOFTWARE, INC. (BSI) CONFIDENTIAL AND PROPRIETARY INFORMATION
Note: If the call to ProcessTaxes returns a non-zero EmployeeStatus, a call to CommitDataSource can be made to COMMIT error messages to the database.
Call the calculation function as follows:
C Instructions:
/*
** Calling the Calculation engine
*/
TF10_EMPLOYEE Employee;
TF10_TAX Tax[50];
TF10_GARNISHMENT Garnishment[50];
BSI_CHAR *RunName = "PAYROLL RUN 1";
TF10_SESSION Session;
BSI_SHORT msgn, msgs;
/*
** Session should be defined by call to ConnectToDataSet – see Step 3
*/
/printf("ProcessTaxes() error\n");
if (!CommitDataSource(NULL))
printf("Commit data source error\n");
/* Retrieve messages from the Last API call */
if(GetMessages(str, Session, NULL)){
printf("ProcessTaxes() returned messages of:\n");
do{
printf("Message: %s\n", str);
}while(GetMessages(str, Session, NULL));
printf("end of messages\n");
}
}
memset(&Employee, 0, sizeof(TF10_EMPLOYEE));
/*
** Populate the Employee details here
** Employee.NumberOfTaxEntries should match the number of the Tax array elements
** Employee.NumberOfGarnishments should match the number of the Garnishment array elements
*/
memset(Tax, 0, Employee.NumberOfTaxEntries * sizeof(TF10_TAX));
/*
** Populate the Tax details here
*/
memset(Garnishment, 0, Employee.NumberOfGarnishments * sizeof(TF10_GARNISHMENT));
/*
** Populate the Garnishment details here
*/
if (!ProcessTaxes(&Employee, Tax, Garnishment, RunName, Session, NULL))
{
printf("ProcessTaxes() error\n");
if (!CommitDataSource(NULL))
printf("Commit data source error\n");
/* Retrieve messages from the Last API call */
if(GetMessages(str, Session, NULL)){
printf("ProcessTaxes() returned messages of:\n");
do{
printf("Message: %s\n", str);
}while(GetMessages(str, Session, NULL));
printf("end of messages\n");
}
}
COBOL Instructions:
COPY TF10API.
.
.
.
.
.
CALL "TF1007" USING
BY REFERENCE TF10-EMPLOYEE
BY REFERENCE TF10-TAX-GROUP
BY REFERENCE TF10-GARNISHMENT-GROUP
BY REFERENCE TF10-RUN-ID
BY REFERENCE TF10-SESSION-ID
BY REFERENCE RTN-CODE.
IF TF10-EMPL-EMPLOYEE-STATUS NOT = 0 OR RTN-CODE NOT = 0
DISPLAY "EMPLOYEE-STATUS INDICATES MESSAGES"
CALL "TF1005" USING
BY REFERENCE RTN-CODE
CALL "TF1015" USING
BY REFERENCE ERROR-MESSAGE
BY REFERENCE TF10-SESSION-ID
BY REFERENCE RTN-CODE
PERFORM WITH TEST BEFORE UNTIL RTN-CODE = 0
DISPLAY "TAX MESSAGE; **" ERROR-MESSAGE "**"
CALL "TF1015" USING
BY REFERENCE ERROR-MESSAGE
BY REFERENCE TF10-SESSION-ID
BY REFERENCE RTN-CODE
END-PERFORM
ELSE
DISPLAY "EMPLOYEE-STATUS INDICATES SUCCESS"
END-IF.
RPG Instructions:
CALLB 'TF1007'
PARM TFEREC
PARM TFIREC
PARM TFGREC
PARM TFRREC
PARM T9SESS
PARM T9RTNC
TEESTS IFNE *ZEROS
CALLB 'TF1005'
PARM T9RTNC
ENDIF
©Copyright 2021 Business Software, Inc
Unpublished - Rights Reserved Under the Copyright Laws of the United States