33 %initTestcase(i_object=basedatasets.sas, i_desc=Creation of base datasets)
 
   37 %assertTableExists (i_libref =work
 
   39                    ,i_desc   =Table was successfuly created?
 
   41 %assertRecordCount (i_libref    =work
 
   44                    ,i_desc      =Does table contain all expected Rows?
 
   46 %assertPrimaryKey (i_library  =work
 
   48                   ,i_variables=CustomerNumber
 
   49                   ,i_desc     =Is the generated key unique?
 
   52 %assertTableExists (i_libref =work
 
   54                    ,i_desc   =Table was successfuly created?
 
   56 %assertRecordCount (i_libref    =work
 
   59                    ,i_desc      =Does table contain all expected Rows?
 
   61 %assertPrimaryKey (i_library  =work
 
   63                   ,i_variables=ContractNumber)
 
   65 %assertRecordExists (i_dataset  =work.Contracts
 
   66                     ,i_whereExpr=%str(ContractType=1)
 
   67                     ,i_desc     =Do we have at least one record per contract type 1?
 
   69 %assertRecordExists (i_dataset  =work.Contracts
 
   70                     ,i_whereExpr=%str(ContractType=2)
 
   71                     ,i_desc     =Do we have at least one record per contract type 2?
 
   73 %assertRecordExists (i_dataset  =work.Contracts
 
   74                     ,i_whereExpr=%str(ContractType=3)
 
   75                     ,i_desc     =Do we have at least one record per contract type 3?
 
   78 %assertTableExists (i_libref =work
 
   79                    ,i_memname=CustomerContracts
 
   80                    ,i_desc   =Table was successfuly created?
 
   82 %assertRecordCount (i_libref    =work
 
   83                    ,i_memname   =CustomerContracts
 
   85                    ,i_desc      =Does table contain all expected Rows?
 
   87 %assertPrimaryKey (i_library  =work
 
   88                   ,i_dataset  =CustomerContracts
 
   89                   ,i_variables=ContractNumber CustomerNumber)
 
   91 %assertForeignKey (i_mstrLib  =work
 
   92                   ,i_mstMem   =CustomerContracts
 
   93                   ,i_mstKey   =ContractNumber
 
   95                   ,i_lookupMem=Contracts
 
   96                   ,i_lookupKey=ContractNumber
 
   97                   ,i_desc     =Check ContractNumber
 
  100 %assertForeignKey (i_mstrLib  =work
 
  101                   ,i_mstMem   =CustomerContracts
 
  102                   ,i_mstKey   =CustomerNumber
 
  104                   ,i_lookupMem=Customer
 
  105                   ,i_lookupKey=CustomerNumber
 
  106                   ,i_desc     =Check CustomerNumber
 
  109 %assertLog (i_errors=0, i_warnings=0)
 
  113 %initTestcase(i_object=combineddataset.sas, i_desc=Creating combined dataset)
 
  117 %assertTableExists (i_libref =work
 
  118                    ,i_memname=CombinedDataset
 
  119                    ,i_desc   =Table was successfuly created?
 
  121 %assertRecordCount (i_libref    =work
 
  122                    ,i_memname   =CombinedDataset
 
  124                    ,i_desc      =Does table contain all expected Rows?
 
  126 %assertPrimaryKey (i_library  =work
 
  127                   ,i_dataset  =CombinedDataset
 
  128                   ,i_variables=ContractNumber CustomerNumber)
 
  130 %assertRowExpression(i_libref  =work
 
  131                     ,i_memname =CustomerContracts
 
  132                     ,i_where   =%str(not missing %(ContractNumber%))
 
  133                     ,i_desc    =There should be no customers without contracts
 
  136 %assertRowExpression(i_libref  =work
 
  137                     ,i_memname =CustomerContracts
 
  138                     ,i_where   =%str(not missing %(CustomerNumber%))
 
  139                     ,i_desc    =There should be no contracts without customer
 
  142 %assertLog (i_errors=0, i_warnings=0)