|
Well, this is the code they're using:
/* DB_T_GETDELINSCNB.C
/*
/*----------------------------------------------------------------
*/
#include "n_src:vms_types.h"
#include "n_src:include.h"
#include <eclass.h>
#include <einfo.h>
#include "n_src:grp_civ_pilot.h"
static char *ModuleName = "DB_T_GETDELINSCNB";
static char *SoortFunctie = "select";
static long TransactionModeTest = TR_Write;
static struct wrk_dbkey * PODbKey;
static struct wrk_primkey * POPrimKey;
struct wrk_aantalrec UAantal;
/*
________________________________________________________________________________
*/
static
int UitvoerenTest(long ITransAantal)
{
int Status = FAE0101_SUCCES;
char ErrorTxt[128];
struct wrk_primkey LPrimKey;
struct wrk_cnb LCNBRec;
struct wrk_dbkey LCNBKey;
struct wrk_recpresent LRecordPresent;
static char *FunctionName;
LRecordPresent.recordpresent = True;
LPrimKey.cnbnr = POPrimKey[0].cnbnr;
FunctionName = "TstGetDelInsCNB";
mta01_getdelinscnb (&LPrimKey
,&LCNBRec
,&LCNBKey
,&LRecordPresent
);
if (einfo.eclass) {
Status = FAE0101_TASK_EXCEPTION;
sprintf( ErrorTxt, "Class = %d, Error code = %d\n", einfo.eclass,
einfo.ecod
e );
LogSysError(ModuleName,FunctionName,Status,ErrorTxt);
}
/*
FunctionName = "TstDelCNB";
mta01_delcnb (&LCNBKey
);
if (einfo.eclass) {
Status = FAE0101_TASK_EXCEPTION;
sprintf( ErrorTxt, "Class = %d, Error code = %d\n", einfo.eclass,
einfo.ec
ode );
LogSysError(ModuleName,FunctionName,Status,ErrorTxt);
}
else {
FunctionName = "TstInsCNB";
mta01_inscnb (&LCNBRec
,&LCNBKey
);
if (einfo.eclass) {
Status = FAE0101_TASK_EXCEPTION;
sprintf( ErrorTxt, "Class = %d, Error code = %d\n", einfo.eclass,
einfo.ecode )
;
LogSysError(ModuleName,FunctionName,Status,ErrorTxt);
}
}
}
*/
return Status;
}
/*
________________________________________________________________________________
_________________________
InitTest
________________________________________________________________________________
_________________________
*/
static
int InitTest()
{
int Status = FAE0101_SUCCES;
static char *FunctionName = "TstGetDelInsCNB";
POPrimKey = NULL;
PODbKey = NULL;
UAantal.aantal = 200;
if (NotStatusOk(Status)) {
LogSysError(ModuleName,FunctionName,Status,"Aanroep van
Settransaction");
}
else {
Status = MDB_LSTCNBNR(&POPrimKey
,&PODbKey
,&UAantal
);
if (NotStatusOk(Status)) {
LogSysError(ModuleName,FunctionName,Status,"MDB_LSTCNBNR");
}
}
if (UAantal.aantal < 1) {
printf("Geen gegevens om de test uit te voeren");
Status = FAE0101_NIET_VERWERKT;
}
return Status;
}
#include "n_src:Test_Acms_Main.c"
=====================================
/*----------------------------------------------------------------
/* DB_T_GETDELINSCNB.C
/*
/*----------------------------------------------------------------
*/
#include "n_src:vms_types.h"
#include "n_src:include.h"
static char *ModuleName = "DB_T_GETDELINSCNB";
static char *SoortFunctie = "select";
static long TransactionModeTest = TR_Write;
static struct wrk_dbkey * PODbKey;
static struct wrk_primkey * POPrimKey;
static struct wrk_aantalrec UAantal;
/*
*/
static
int UitvoerenTest(long ITransAantal)
{
int Status = FAE0101_SUCCES;
struct wrk_primkey LPrimKey;
struct wrk_cnb LCNBRec;
struct wrk_dbkey LCNBKey;
struct wrk_recpresent LRecordPresent;
static char *FunctionName;
LRecordPresent.recordpresent = True;
LPrimKey.cnbnr = POPrimKey[0].cnbnr;
FunctionName = "TstGetCNB";
Status = MDB_GETCNB (LPrimKey
,&LCNBRec
,&LCNBKey
,&LRecordPresent
);
if (NotStatusOk(Status)) {
LogSysError(ModuleName,FunctionName,Status,"Aanroep van
TstGETCNB");
}
else {
FunctionName = "TstDelCNB";
Status = MDB_DELCNB (LCNBKey
);
if (NotStatusOk(Status)) {
LogSysError(ModuleName,FunctionName,Status,"Aanroep van
TstDELCNB");
}
else {
FunctionName = "TstInsCNB";
Status = MDB_INSCNB (LCNBRec
,&LCNBKey
);
if (NotStatusOk(Status)) {
LogSysError(ModuleName,FunctionName,Status,"Aanroep van
TstINSCNB");
}
}
}
return Status;
}
/*
*/
static
int InitTest()
{
int Status = FAE0101_SUCCES;
static char *FunctionName = "TstGetDelInsCNB";
POPrimKey = NULL;
PODbKey = NULL;
UAantal.aantal = 200;
if (NotStatusOk(Status)) {
LogSysError(ModuleName,FunctionName,Status,"Aanroep van
Settransaction");
}
else {
Status = MDB_LSTCNBNR(&POPrimKey
,&PODbKey
,&UAantal
);
if (NotStatusOk(Status)) {
LogSysError(ModuleName,FunctionName,Status,"MDB_LSTCNBNR");
}
}
if (UAantal.aantal < 1) {
printf("Geen gegevens om de test uit te voeren");
Status = FAE0101_NIET_VERWERKT;
}
return Status;
}
#include "n_src:TestMain.c"
==================================================
#CINCLUDE "wrk_dbkey.stdl"
#CINCLUDE "wrk_primkey.stdl"
#CINCLUDE "wrk_cnb.stdl"
#CINCLUDE "wrk_recpresent.stdl"
#CINCLUDE "wrk_aantalrec.stdl"
#CINCLUDE "prc_civ_pilot.stdl"
#CINCLUDE "grp_civ_pilot.stdl"
TASK mta01_getdelinscnb
WORKSPACES ARE
wrk_primkey,
wrk_cnb,
wrk_dbkey,
wrk_recpresent;
TASK ARGUMENTS ARE
wrk_primkey passed as input,
wrk_cnb passed as output,
wrk_dbkey passed as output,
wrk_recpresent passed as inout;
BLOCK WITH TRANSACTION
PROCESSING
CALL PROCEDURE mps_getcnb
IN prc_civ_pilot
USING wrk_primkey,
wrk_cnb,
wrk_dbkey,
wrk_recpresent;
PROCESSING
CALL PROCEDURE mps_delcnb
IN prc_civ_pilot
USING wrk_dbkey;
PROCESSING
CALL PROCEDURE mps_inscnb
IN prc_civ_pilot
USING wrk_cnb,
wrk_dbkey;
END BLOCK
ACTION IS
EXIT TASK WITH COMMIT TRANSACTION;
END ACTION
EXCEPTION HANDLER IS
EXIT TASK WITH ROLLBACK TRANSACTION;
END EXCEPTION;
END TASK;
|