PMOV Functional Decomposition Analysis
PMOV Functional Decomposition Analysis
Mark A. Norrie
Actuarial Infrastucture
Contents
TABLES ......................................................................................................................... 1
PROCESSES .................................................................................................................... 2
COMPLEX ........................................................................................................................2
C01 UWC_PNCB Fix Overlap Inforce Period ..........................................................................2
C02 UWC PNCH Building PMOV .........................................................................................4
C03 UWC Policy Fix .......................................................................................................8
C04 UWC_PNCB_Premtran ..............................................................................................9
C05 UWC Fix overlap dates and filter unwanted products ..................................................... 10
C06 SAS Extract - Change pcode from Num to Char .............................................................. 11
SIMPLE ........................................................................................................................ 12
SAS Extract .............................................................................................................. 12
P01 ...................................................................................................................... 12
P04 ...................................................................................................................... 12
P15 ...................................................................................................................... 13
P21 ...................................................................................................................... 15
P27 ...................................................................................................................... 16
P28 ...................................................................................................................... 16
P29 ...................................................................................................................... 17
P31 ...................................................................................................................... 17
P32 ...................................................................................................................... 18
SPD Server Loader ...................................................................................................... 19
P02 ...................................................................................................................... 19
P12 ...................................................................................................................... 19
P23 ...................................................................................................................... 21
P25 ...................................................................................................................... 23
P35 ...................................................................................................................... 25
Extract Source Data Required cols .................................................................................. 31
P03 ...................................................................................................................... 31
P19 ...................................................................................................................... 32
P24 ...................................................................................................................... 32
SQL Join .................................................................................................................. 33
P05 ...................................................................................................................... 33
P06 ...................................................................................................................... 38
P09 ...................................................................................................................... 43
P33 ...................................................................................................................... 48
P34 ...................................................................................................................... 55
Lookup .................................................................................................................... 61
P07 ...................................................................................................................... 61
P08 ...................................................................................................................... 65
P10 ...................................................................................................................... 70
P13 ...................................................................................................................... 74
P30 ...................................................................................................................... 81
SAS Splitter .............................................................................................................. 83
P11 ...................................................................................................................... 83
P14 ...................................................................................................................... 84
P17 ...................................................................................................................... 84
P22 ...................................................................................................................... 85
Append ................................................................................................................... 85
P16 ...................................................................................................................... 85
Table Loader ............................................................................................................ 86
P18 ...................................................................................................................... 86
P36 ...................................................................................................................... 92
P37 ...................................................................................................................... 96
User Defined Summary Statistics .................................................................................... 96
P20 ...................................................................................................................... 96
User Written Code ...................................................................................................... 98
P26 ...................................................................................................................... 98
Tables
T01 PREMTRAN
T02 POLICY
T03 ITEM
T04 ITEMRI
T05 Staging Niche PI – Hx Ret Prem Dtls
T06 POLICYTH
T07 Staging Niche PI – Hx Co-ins Prem Dtls
T08 PROPOSAL
T09 ADDRESS
T10 AGENT
T11 AGTGRP
T12 AUTINDEX
T13 Staging Niche PI – Hx Reversed Txns
T14 CLASSTYP
T15 COMSCALE
T16 Protect Niche PI – Hx Policy Movt
T17 Error PI – Hx Error Terms
T18 Staging Niche PI – Generic HX Cov Dtls
T19 Protect Niche PI – Hx Master Key
%let trans_rc = 0;
/* make sure the code generates in the required order i.e. work.W5J1AM3C was created
before this */
/* Get tran type from PREMTRAN */
DATA _premtranAtrnType (KEEP= company product policy itemNo trancnt atrnType
INDEX=(key1=(company product policy itemNo trancnt) ));
SET work.W5J1AM3C;
RUN;
DATA spdswork._premtranAtrnType1;
SET &_SYSLAST.;
SET _premtranAtrnType KEY=key1 / UNIQUE;
IF _ERROR_ THEN DO;
_ERROR_ = 0;
atrnType = ' ';
END;
RUN;
/* As Protect defined Lapsed policies as current term with Effective Date of next term
and Expiry date the same as Effective Date */
/* This code is used to redefine Lapsed as similar to GIO Cogen */
IF INTCK('DAY',covRenewedDate,covChgEffDate) IN (365,366) AND itemAtrnType IN
('CN','LP') THEN DO;
modified = modified + 2; /* 0000000010 - Identify lapsed transactions that should
be for next term hence change date fields accordingly */
covRenewedDate = covChgEffDate;
covChgExpDate = INTNX('MONTH',covChgEffDate,12,'SAMEDAY');
inforceExpDate = covCHgExpdate;
IF itemAtrnType = 'CN' THEN DO;
itemAtrnType = 'LP';
modified = modified + 4; /*0000000100 - Identify Item transaction type
changed from CN to LP */
END;
END;
ELSE IF INTCK('DAY',covRenewedDate,covChgEffDate) IN (365,366) AND itemAtrnType = ' '
THEN DO;
covRenewedDate = covChgEffDate;
modified = modified + 32; /*0000100000 - Identify covRenewedDate change to
CovChgEffDate for none lapsed/cancel transactions that has effective date more than a
year from covRenewedDate */
END;
/* Back-dated change the duedate for all transactions that have the same effective date
usng the latest transaction within the same effective date */
/* This is due to DUE DATE ALTERATION transactions that lead to incorrect earned premium
calculation */
DATA spdswork._fixpmv1;
SET spdswork._fixpmv0;
BY company product policy itemno covRenewedDate covChgEffDate trancnt;
ATTRIB _covChgExpDate LENGTH=5 FORMAT=DATE9. ;
RETAIN _covChgExpDate 0;
IF FIRST.covChgEffDate THEN DO;
_covChgExpDate = covChgExpDate;
END;
/* Identify change to the duedate */
IF _covChgExpDate NE covChgExpDate THEN modified = modified + 256;
DROP covChgExpDate;
RENAME _covChgExpDate = covChgExpDate;
RUN;
RETAIN join_dt ;
DROP join_dt;
RUN;
%rcSet(&syserr);
%rcSet(&sqlrc);
%let trans_rc = 0;
DATA spdswork.Bef_CovKey;
ATTRIB
/* coverageKey LENGTH=8 LABEL='Coverage Key' */
company LABEL='Company'
product LABEL='Product'
class LABEL='Class'
subclass LABEL='Subclass'
policy LABEL='Policy Number'
seqPolicy LABEL='Sequence Policy
Number'
itemNo LABEL='Item No'
termIdent LENGTH=$3 LABEL='Term Identification'
trancnt LABEL='Transaction Count'
orgTrncnt LENGTH=4 LABEL='Original Transaction
Count being Reversed'
reverseTrncnt LENGTH=4 LABEL='This trans has been
Reversed By this Transaction Count'
covRenewedDate LENGTH=5 format=DATE9. LABEL='Coverage Renew Date'
covChgEffDate LENGTH=5 format=DATE9. LABEL='Coverage Change
Effective Date'
covChgExpDate LENGTH=5 format=DATE9. LABEL='Coverage Change Expiry
Date'
policyInceptDate LENGTH=5 format=DATE9. LABEL='Policy Inception Date'
transactionDate LENGTH=5 format=DATE9. LABEL='Transaction Date'
trantime LENGTH=4 LABEL='Transaction Time'
glDate LENGTH=5 format=DATE9. LABEL='General Ledger Date'
inforceIncDate LENGTH=5 FORMAT=DATE9. LABEL='In Force Inception
Date'
inforceExpDate LENGTH=5 FORMAT=DATE9. LABEL='In Force Expiry Date'
/* Define coverageKey - Vero Protect niche Company specific start with 1100000000, 1st
digit for system 2nd digit for company */
/*RETAIN coverageKey 1100000000;
RETAIN coverageKey 0;
IF FIRST.trancnt THEN coverageKey+1;
*/
/* 0000001000 - Flag to identify that all financial fields from ITEM are set to zero
as there are no corresponding records in PREMTRAN */
IF premtranTranDate = . THEN DO;
modified = modified + 8;
/* Define user transaction type base on PREMTRAN transaction type and ITEM transaction
Type and ITEM status */
SELECT;
when(atrnType = 'RV') transactionType = 'RV';
when(itemAtrnType = 'LP' AND itmStatus = 'V') transactionType = 'LP';
when(itemAtrnType = 'CN' AND itmStatus = 'V') transactionType = 'CN';
when(atrnType = 'NB') transactionType = 'NB';
when(atrnType = 'RE') transactionType = 'RE';
when(atrnType = 'RP') transactionType = 'RP';
when(atrnType = 'EP') transactionType = 'EP';
when(atrnType = 'CN') transactionType = 'CN';
otherwise transactionType = 'EN';
END;
/* As lookup for POLICYTH was done for all transactions instead of only 'RV' in
previous step so this is */
/* to reset these values for none RV transactions */
IF atrnType NE 'RV' THEN DO;
orgTrncnt = 0;
END;
/* Calculate the earned premium/commission per day for each transaction and
accummulate within the same term;*/
IF (covChgExpDate - covChgEffDate) = 0 THEN DO;
tranEarnPremPerDay = 0;
tranEarnCommPerDay = 0;
END;
ELSE DO;
tranEarnPremPerDay = incGrossPrem / (covChgExpDate - covChgEffDate);
tranEarnCommPerDay = incCommission1 / (covChgExpDate - covChgEffDate);
END;
END;
/* Define valid transaction types for inforce - NEED MORE WORK HERE in term of
REVERSAL ???? */
tranInforce = NOT (transactionType IN ('LP','CN') OR itmStatus = 'V' OR
(transactionType = 'RV' AND cumGrossPrem = 0)
);
/* Identify when extra,return premium effected 1,2 or 3 days before it expired and the
Abolute value of premium is more than $2 i.e. +/- $2 */
IF cumGrossPrem - incGrossPrem NE 0 THEN DO;
IF INTCK('DAY',inforceIncDate,inforceExpDate) IN (1,2,3) AND ABS(INT(incGrossPrem))
> 2 THEN DO;
modified = modified + 16;/* 0000010000 - Flag to identify the above case */
END;
END;
/* Modify the tranInforce for the last transaction of the last term to see if they are
endorsements and CUMGROSSPREM = 0 and */
/* currently flag as inforced which might not be correct as the risk has not being
renewed -> the reason was by default all */
/* endorsement transactions except Cancel / Lapse has been set as inforced transaction
*/
IF LAST.itemNo AND transactionType NOT IN ('NB','RE','LP','CN') AND INT(cumGrossPrem) =
0 AND tranInforce THEN DO;
modified = modified + 64;
tranInforce = 0;
END;
/*Unique coveragekey
coverageKey=MONOTONIC() + 5000000000; */
RUN;
IF a=b THEN
DO;
coverageKey = CK_old;
output &_OUTPUT.;
END;
ELSE IF a then DO;
coveragekey1+1;
coverageKey =coveragekey1;
output &_OUTPUT.;
output dbpnchpl.MASTERKEY_PI;
END;
drop coverageKey1;
RUN;
%let trans_rc = 0;
%rcSet(&syserr);
C04 UWC_PNCB_Premtran
/*============================================================================*
* Step: UWC_PNCB_Premtran A55NWR2B.BI00K7N8 *
* Transform: User Written Code *
* Description: As in Premtran there are cases when multiple records *
* within each COMPANY+PRODUCT+POLICY+ITEMNO+TRANCNT , there *
* isa need to accumulate the premium amounts but keep the *
* TRANDATE of the latest record. *
* *
* Source Table: test1 - spdswork.W5J1AN5G A55NWR2B.BL00A9LQ *
* Target Table: User Written Code Target - work.W5J1AM3C A55NWR2B.BL00A9LR *
* *
* User Written: Extract PremTran A55NWR2B.AF00OCJO *
* Extract PremTran *
*============================================================================*/
%let trans_rc = 0;
/* Get rid of duplicate records within the same trancnt with premium = 0 */
/*DATA _premtran1;*/
DATA spdswork._premtran1;
SET &SYSLAST.;
BY company product policy itemno trancnt trandate;
IF NOT (FIRST.trancnt AND LAST.trancnt) AND tbasicprm = 0 THEN DELETE;
RUN;
RETAIN cumtbasicprm 0;
IF FIRST.trancnt THEN DO;
cumtbasicprm = 0;
END;
cumtbasicprm = cumtbasicprm + tbasicprm;
IF LAST.trancnt ;
RUN;
%rcSet(&syserr);
%rcSet(&sqlrc);
%let trans_rc = 0;
DATA &_OUTPUT.;
SET &SYSLAST.( keep= company product policy effectdte activto trancnt
rec_type_cd imageFlag MPDISC PRVINSCOY CPBUSSRC CAMPCODE PRVINSIND PRVINSPOL LOYDATE
WHERE=((PUT(COMPANY, ? z2.) in ('01','02','04','05','11')
OR (PUT(COMPANY, ? z2.) = '03' AND put(PRODUCT,$CIA_PDS1a. ) NE 'CI'))
AND product NOT IN ('CVN','QTE')
AND (rec_type_cd NE 3)
AND imageFlag IN (' ','I'))) end=eof;
BY company product policy DESCENDING effectdte DESCENDING activto trancnt ;
ATTRIB
_effectdte LENGTH=5 FORMAT=DATE9. LABEL= 'Effective Date'
_activto LENGTH=5 FORMAT=DATE9. LABEL= 'Active To Date'
;
IF activto = 99999999 AND effectdte < 20000101 THEN DELETE;
RETAIN joinDt prevEffectDte prevActivto _lapsedCnt 0;
%convertdate(effectdte,_effectdte);
IF activto = 99999999 THEN _activto = '31Dec9999'd;
ELSE DO;
%convertdate(activto,_activto);
END;
IF FIRST.policy THEN DO;
joinDt = _effectdte - 1;
prevEffectDte = .;
prevActivTo = .;
END;
ELSE DO;
/* The older transactions has effective period already covered in the
previous transaction */
IF _effectDte >= prevEffectDte AND _activto <= prevActivTo THEN DELETE;
%rcSet(&syserr);
%rcSet(&sqlrc);
%let trans_rc = 0;
proc sql;
create table work.W65KIXJX as
select ADDRREF length = 8 label = 'Address Reference Number',
(case when length(left(put(POSTCODE,6.)))< 4 then left(put(POSTCODE,z4.))
else left(put(POSTCODE,6.)) end) as POSTCODE length = 6,
CITY length = 40 label = 'City/Town/Suburb Name',
md5_key length = 32 label = 'Natural key indentified by MD5 hash of the
concatenation of business keys',
rec_type_cd length = 8 label = 'Record type code sourced from the extract
identifying whether the record is new (1), modified (2), delete (3) or snapshot (4).',
batch_key length = 8 label = 'Key to Programme Register identifying the
details of the batch run which populated the record.',
run_reg_key length = 8 label = 'Key to Run Register identifying the details
of the etl_process run which populated the record.',
row_insert_dt length = 8 label = 'Timestamp identifying when the record was
inserted in the SRC table.',
row_effective_dt length = 8 label = 'Timestamp identifying records effective
date/time from operational system if available.',
audit_flag length = 1 label = 'Flag indicating whether the record is
operational (O) or maintenance (M) as a consequence of a data audit process.',
STREETNO length = 8 label = 'Street Number',
STREETIND length = 1 label = 'Code To Distinguish Within Street Number',
ADDRIND1 length = 1 label = 'Fflu -Indicator 1',
ADDRNO1 length = 8 label = 'Number Relating To The First Address Code',
ADDRIND2 length = 1 label = 'Fflu -Indicator 2',
ADDRNO2 length = 8 label = 'Number Relating To The Second Address Code',
%rcSet(&sqlrc);
Simple
SAS Extract
P01
/*============================================================================*
* Step: SAS Extract A55NWR2B.BI00K7NC *
* Transform: Extract *
* Description: *
* *
* Source Table: PNCH_PREMTRAN - dbpncstg.PNCH_PREMTRAN A55NWR2B.BX001CW2 *
* Target Table: Extract Target - work.W66IEP17 A55NWR2B.BL00A9LU *
* *
* User Written: Not Used A55NWR2B.AF00OCJQ *
*============================================================================*/
%let trans_rc = 0;
%rcSet(&syserr);
%rcSet(&sqlrc);
P04
/*============================================================================*
* Step: ITEM Extract A55NWR2B.BI00K7NR *
* Transform: User Written Code *
* Description: Extract ITEM records based on the user defined format that *
* define how many years of data to retain. *
* *
* Source Table: Extract_Source_Data_With_TimeStamp_reqdc A55NWR2B.BL00A9M4 *
* ols - spdswork.W66CP32B *
* Target Table: User Written Code Target - A55NWR2B.BL00A9M5 *
* spdswork.W5J4C0T7 *
* *
* User Written: Item Cutoff A55NWR2B.AF00OCKG *
* Extract ITEM records base on the no of years being *
* retained *
*============================================================================*/
%let trans_rc = 0;
DATA _NULL_;
ATTRIB dt1 LENGTH=5 FORMAT=DATE9. ;
/*dt1 = INTNX('SEMIYEAR',INTNX('YEAR',"&SYSDATE."d,-
INPUT(PUT(¶_comp.,1.),pnchcutoff.)),1);*/
dt1 = INTNX('SEMIYEAR',INTNX('YEAR',"&SYSDATE."d,-8),1);
CALL SYMPUT('cutoffDt',dt1);
RUN;
/*** Added COMPANY 11 for Insure policies***/
/*DATA &_OUTPUT. / VIEW=&_OUTPUT.;*/
DATA &_OUTPUT. ;
SET &SYSLAST.(WHERE=((PUT(COMPANY, ? z2.) in ('01','02','04','05','11') OR
(PUT(COMPANY, ? z2.) = '03' AND
put(COMPRESS(product)||COMPRESS(class)||COMPRESS(subclass), $CIA_PDS1a. ) NE 'CI')) AND
INPUT(PUT(termincep,8.), ? yymmdd8.) >= &cutoffDt. ));
/* SET &SYSLAST.(WHERE=((PUT(COMPANY, ? z2.) in ('01','02','04','05') OR (PUT(COMPANY,
? z2.) = '03' AND put(COMPRESS(product)||COMPRESS(class)||COMPRESS(subclass),
$CIA_PDS1a. ) = 'PI')) AND INPUT(PUT(termincep,8.), ? yymmdd8.) >= &cutoffDt. ));*/
/* change cancellation date to 1 day after the Total Loss claims as currently system
generate cancel date the same day as total loss occur */
_effectDate = effectDte;
IF reasoncde = '14' AND effectdte < duedate THEN DO;
%convertdate(effectdte,_EffectDate1);
_effectDate = INPUT(PUT(INTNX('DAY',_effectDate1,1), YYMMDDN8.), 8.);
END;
DROP _EffectDate1 effectDte;
RENAME _effectDate = effectDte;
RUN;
/* this code use when cutoff date definition extent to product,class,subclass from
existing company */
/*
DATA &_OUTPUT. / VIEW=&_OUTPUT.;
SET &SYSLAST.(WHERE=(PUT(company, ? z2.)="¶_comp." ));
IF INPUT(PUT(termincep,8.), ?? yymmdd8.) >=
INTNX('SEMIYEAR',INTNX('YEAR',"&SYSDATE."d,-
(INPUT(COMPRESS(put(company,1.))||COMPRESS(product)||COMPRESS(class)||COMPRESS(subclass)
,pnchcutoff.))),1);
RUN;
*/
%rcSet(&syserr);
%rcSet(&sqlrc);
P15
/*============================================================================*
* Step: SAS Extract A55NWR2B.BI00K7O2 *
* Transform: Extract *
* Description: *
* *
* Source Table: Splitter Target 1 - work.W66O0OT3 A55NWR2B.BL00A9MH *
* Target Table: Extract Target - work.W66O1GOS A55NWR2B.BL00A9MJ *
*============================================================================*/
proc sql;
create view work.W66O1GOS as
select FIREBRIG length = 1 label = 'FIREBRIG',
COYISSUED length = 8 label = 'COYISSUED',
itemNo length = 8 label = 'Item No',
modified length = 8 label = 'Flag to identify User Modifications in Binary
00000000',
GRPNAME length = 60 label = 'Group Name',
MANCOMRTE length = 8 label = 'MANCOMRTE',
POLSTATUS length = 1 label = 'POLSTATUS',
PREMREASA length = 2 label = 'PREMREASA',
inforceIncDate length = 5 label = 'In Force Inception Date',
incCommission1 length = 4 label = 'Transaction Commission',
RCOMMISN length = 8 label = 'RCOMMISN',
incGrossPrem length = 5 label = 'Transaction Basic Premium',
reverseTrncnt length = 8 label = 'Transaction Count',
BRCHRESP length = 8 label = 'BRCHRESP',
CUSTREF length = 14 label = 'CUSTREF',
LOCKUSER length = 8 label = 'LOCKUSER',
CITY length = 40 label = 'City/Town/Suburb Name',
covRenewedDate length = 5 label = 'Coverage Renew Date',
incCommGst length = 4 label = 'Amount of GST on Transaction Commision',
OCCUPATN length = 4 label = 'OCCUPATN',
cumEarnPremPerDay length = 5 label = 'Cummulative Earned Premium Per day',
coinsPrem length = 8 label = 'Coinsurance Premium',
AGENTSTATE length = 8 label = 'State Code',
subclass length = 3 label = 'Subclass',
ORGTRNCNT length = 8 label = 'ORGTRNCNT',
COMPLTIND length = 1 label = 'COMPLTIND',
RGST length = 8 label = 'RGST',
SPCLSIND length = 1 label = 'SPCLSIND',
STATE length = 8 label = 'STATE',
CAMPCODE length = 10 label = 'CAMPCODE',
BRANCH length = 8 label = 'BRANCH',
covChgEffDate length = 5 label = 'Coverage Change Effective Date',
DISTRICT length = 2 label = 'DISTRICT',
CANCDECLN length = 1 label = 'CANCDECLN',
STISSUED length = 2 label = 'STISSUED',
tranEarnPremPerDay length = 5 label = 'Trans Earned Premium Per Day',
INDEXIND length = 1 label = 'INDEXIND',
tranEarnCommPerDay length = 5 label = 'Trans Earned Commission Per Day',
EXCESS length = 8 label = 'EXCESS',
CPBUSSRC length = 10 label = 'Corporate Partners Source Of Business',
qsPrem length = 5 label = 'Quota Share Premium',
FIELD04 length = 4 label = 'Reserved For Future Use',
NTCETYPE length = 1 label = 'NTCETYPE',
cumEarnCommPerDay length = 5 label = 'Cummulative Earned Commission Per
day',
GSTEXCLUD length = 2 label = 'Gst Exclusion',
SDEXCLUD length = 2 label = 'Stamp Duty Exclusion Code.',
COMREAS length = 2 label = 'COMREAS',
atrnType length = 2 label = 'Premtran - Transaction Type',
REP length = 8 label = 'REP',
CHGEXCLUD length = 2 label = 'Code For Reason Of Exclusion Of Charges',
NTCEPROD length = 1 label = 'NTCEPROD',
glDate length = 5 label = 'General Ledger Date',
COINSPC length = 8 label = 'COINSPC',
incGst length = 4 label = 'Amount of GST on Transaction Premium',
stampDuty length = 4 label = 'Transaction Stamp Duty',
tranInforce length = 3 label = 'Inforce Transaction 1(Yes)/0(No)',
BUSDESC length = 1 label = 'BUSDESC',
cumGrossPrem length = 5 label = 'Cummulative Premium Amount',
policy length = 8 label = 'Policy Number',
cumStampDuty length = 4 label = 'Cummulative Stamp Duty Amount',
covChgExpDate length = 5 label = 'Coverage Change Expiry Date',
policyInceptDate length = 5 label = 'Policy Inception Date',
cumCommission1 length = 4 label = 'Cummulative Commission Amount',
PRVINSPOL length = 14 label = 'Previous Policy Code',
premtranTRANDATE length = 5 label = 'Transaction Date',
REVIEWIND length = 1 label = 'REVIEWIND',
RISKSTATE length = 2 label = 'RISKSTATE',
AGTGROUP length = 8 label = 'Agent Group Number',
DISCREAS length = 2 label = 'DISCREAS',
REBATEPC length = 8 label = 'REBATEPC',
itemAtrnType length = 2 label = 'Item - Transaction Type',
AGTCLUSTR length = 4 label = 'Agent Cluster',
EXCESSTYP length = 1 label = 'EXCESSTYP',
%rcSet(&sqlrc);
P21
/*============================================================================*
* Step: SAS Extract - ITEMRI A55NWR2B.BI00K7NJ *
* Transform: Extract *
* Description: Get Coinsurance and RI Premium *
* *
* Source Table: PNCH_ITEMRI - dbpncstg.PNCH_ITEMRI A55NWR2B.BX001CVA *
* Target Table: Extract Target - work.W5JR5REU A55NWR2B.BL00A9LL *
*============================================================================*/
%let trans_rc = 0;
proc sql;
create table work.W5JR5REU as
select COMPANY length = 8 format = 6. informat = 6. label = 'COMPANY',
PRODUCT length = 3 format = $3. informat = $3. label = 'PRODUCT',
POLICY length = 8 format = 11. informat = 11. label = 'POLICY',
ITEMNO length = 8 format = 6. informat = 6. label = 'ITEMNO',
TRANCNT length = 8 format = 6. informat = 6. label = 'TRANCNT',
RITYPE length = 1 format = $1. informat = $1. label = 'RITYPE',
(SUM(PREMIUM)) as retRiPrem length = 8 format = 13.2 informat = 13.2,
(SUM(QSPREM)) as QSPREM length = 8 format = 13.2 informat = 13.2,
(SUM(CATPREM)) as CATPREM length = 8 format = 13.2 informat = 13.2,
(SUM(EOLPREM)) as EOLPREM length = 8 format = 13.2 informat = 13.2,
(SUM(SPECPREM)) as SPECPREM length = 8 format = 13.2 informat = 13.2
from &SYSLAST
where (PUT(COMPANY, ? z2.) in ('01','02','04','05','11') OR (PUT(COMPANY, ?
z2.) = '03' AND put(PRODUCT,$CIA_PDS1a. ) NE 'CI')) AND PRODUCT NOT IN ('QTE','CVN')
AND RITYPE IN ('R','P') AND STATUSIND IN ('S','C') AND rec_type_cd NE 3
group by COMPANY, PRODUCT, POLICY, ITEMNO, TRANCNT, RITYPE;
quit;
%let SYSLAST = work.W5JR5REU;
%rcSet(&sqlrc);
P27
/*============================================================================*
* Step: SAS Extract A55NWR2B.BI00K7N7 *
* Transform: Extract *
* Description: *
* *
* Source Table: PNCH_AGTGRP - D_S_PNCH.PNCH_AGTGRP A55NWR2B.BX0002BT *
* Target Table: AGTGRP - work.W667I6HD A55NWR2B.BL00A9LP *
*============================================================================*/
%let trans_rc = 0;
proc sql;
create table work.W667I6HD as
select COMPANY length = 8 format = 6. informat = 6. label = 'Company Code',
AGTGROUP length = 8 label = 'Agent Group Number',
AGTCLUSTR length = 4 label = 'Agent Cluster',
GRPNAME length = 60 label = 'Group Name'
from &SYSLAST
where (PUT(COMPANY, ? z2.) in ('01','02','03','04','05','11')) and STATUS <>
'V' and ACTIVTO = 99999999 and rec_type_cd NE 3;
quit;
%rcSet(&sqlrc);
P28
/*============================================================================*
* Step: SAS Extract A55NWR2B.BI00K7NE *
* Transform: Extract *
* Description: *
* *
* Source Table: User Written Code Target - work.W667HWHQ A55NWR2B.BL00A9LV *
%let trans_rc = 0;
proc sql;
create table work.W667HY6U as
select COMPANY length = 4 label = 'Company Code',
AGENT length = 6 label = 'Agent Number For Database Access',
AGTGROUP length = 6 label = 'Broker Group Number',
COMSCALE length = 4 label = 'Commission Scale',
STATE as AGENTSTATE length = 8 label = 'State Code'
from &SYSLAST
where PUT(COMPANY, ? z2.) in ('01','02','03','04','05','11') and rec_type_cd
NE 3;
quit;
%rcSet(&sqlrc);
P29
/*============================================================================*
* Step: SAS Extract A55NWR2B.BI00K7NM *
* Transform: Extract *
* Description: *
* *
* Source Table: PNCH_AUTINDEX - D_S_PNCH.PNCH_AUTINDEX A55NWR2B.BX003LMQ *
* Target Table: AUTINDEX - work.W667HQLA A55NWR2B.BL00A9M1 *
*============================================================================*/
%let trans_rc = 0;
proc sql;
create table work.W667HQLA as
select COMPANY length = 8 format = 6. informat = 6. label = 'COMPANY',
PRODUCT length = 3 label = 'PRODUCT',
STATE length = 8 format = 6. informat = 6. label = 'STATE',
CLASS length = 3 format = $3. informat = $3. label = 'CLASS',
SUBCLASS length = 3 format = $3. informat = $3. label = 'SUB CLASS',
INDEXPERC length = 6 label = 'INDEX PERC'
from &SYSLAST
where (PUT(COMPANY, ? z2.) in ('01','02','04','05','11') OR ( PUT(COMPANY, ?
z2.) = '03' AND put(PRODUCT,$CIA_PDS1a. ) NE 'CI')) AND PRODUCT NOT IN ('QTE','CVN')
and rec_type_cd NE 3 and ACTIVTO = 99999999;
quit;
%rcSet(&sqlrc);
P31
/*============================================================================*
* Step: SAS Extract A55NWR2B.BI00K7NH *
* Transform: Extract *
* Description: *
* *
* Source Table: PNCH_CLASSTYP - D_S_PNCH.PNCH_CLASSTYP A55NWR2B.BX0002C2 *
* Target Table: Extract Target - work.W66NJTRK A55NWR2B.BL00A9LZ *
*============================================================================*/
%let trans_rc = 0;
proc sql;
create view work.W66NJTRK as
select COMPANY length = 4 informat = IB002. label = 'COMPANY',
STATE length = 4 informat = IB002. label = 'STATE',
CLASS length = 3 informat = $EBCDIC003. label = 'CLASS',
SUBCLASS length = 3 informat = $EBCDIC003. label = 'SUBCLASS',
COMPRODCT length = 1 informat = $EBCDIC001. label = 'COMPRODCT',
COMSUBCLS length = 1 informat = $EBCDIC001. label = 'COMSUBCLS'
from &SYSLAST
where COMPANY in (3, 5) and rec_type_cd ne 3;
quit;
%rcSet(&sqlrc);
P32
/*============================================================================*
* Step: SAS Extract A55NWR2B.BI00K7NO *
* Transform: Extract *
* Description: *
* *
* Source Table: PNCH_COMSCALE - D_S_PNCH.PNCH_COMSCALE A55NWR2B.BX0002DD *
* Target Table: Extract Target - work.W667ICOF A55NWR2B.BL00A9M2 *
*============================================================================*/
/* Access the data for Daily Protect Niche Source Layer Data */
LIBNAME D_S_PNCH SASSPDS GROUP='production' user="&uid" passwd ="&pw"
schema="D_S_PNCH" HOST='sasap2' Serv='5090' ;
%rcSet(&syslibrc);
%let trans_rc = 0;
proc sql;
create view work.W667ICOF as
select COMPANY length = 8 label = 'COMPANY',
STATE length = 8 label = 'STATE',
PRODUCT length = 3 label = 'PRODUCT',
CLASS length = 3 label = 'CLASS',
SCALE length = 8 label = 'SCALE',
(case when ACTIVFROM = 20100229 then "28FEB2010"D
else INPUT(PUT(ACTIVFROM ,8.) ,?YYMMDD8.) end) as ACTIVFROM length = 8
format = DATE9.,
(case when ACTIVTO = 20100229 then "28FEB2010"D
when ACTIVTO = 99999999 then "31DEC2099"D
else INPUT(PUT(ACTIVTO ,8.) ,?YYMMDD8.) END) as ACTIVTO length = 8 format =
DATE9.,
NBRATE length = 8 label = 'NBRATE',
RENRATE length = 8 label = 'RENRATE',
NOMRATENB length = 8 label = 'NOMRATENB',
NOMRATEREN length = 8 label = 'NOMRATEREN',
SUBCLASS length = 3 informat = $EBCDIC3. label = 'SUBCLASS'
from &SYSLAST
where PUT(COMPANY, ? z2.) in ('03','05') AND rec_type_cd ne 3
order by COMPANY, STATE, PRODUCT, CLASS, SCALE, ACTIVFROM, ACTIVTO desc;
quit;
P02
/*============================================================================*
* Step: SPD Server Loader A55NWR2B.BI00K7ND *
* Transform: SPD Server Table Loader *
* Description: *
* *
* Source Table: Extract Target - work.W66IEP17 A55NWR2B.BL00A9LU *
* Target Table: PNCH_ITEM - dbpncstg.PNCH_ITEM A55NWR2B.BX001CV9 *
* *
* User Written: Not Used A55NWR2B.AF00OCJR *
*============================================================================*/
%let trans_rc = 0;
%rcSet(&syserr);
%rcSet(&sqlrc);
P12
/*============================================================================*
* Step: SPD Server Loader A55NWR2B.BI00K7N6 *
* Transform: SPD Server Table Loader *
* Description: *
* *
* Source Table: Splitter Target 2 - work.W5JEMGHM A55NWR2B.BL00A9LO *
* Target Table: Staging Niche PI - Reversed Transactions A55NWR2B.BX004XHA *
* - dbnchpis.REVERSETRANS_PI *
*============================================================================*/
%let trans_rc = 0;
%global etls_tableExist;
%global etls_numIndex;
%global etls_lastTable;
%let etls_tableExist = -1;
%let etls_numIndex = -1;
%let etls_lastTable = &SYSLAST;
%let etls_tableExist = 0;
data dbnchpis.REVERSETRANS_PI
(label = 'Staging Niche PI - Reversed Transactions');
attrib COMPANY length = 8 format = 6. informat = 6.
label = 'Company';
attrib PRODUCT length = $3 format = $3. informat = $3.
label = 'Product';
attrib POLICY length = 8 format = 11. informat = 11.
label = 'Policy Number';
attrib ITEMNO length = 8 format = 6. informat = 6.
label = 'Item No';
attrib reverseTrncnt length = 8 format = 6. informat = 6.
label = 'Transaction Count';
attrib trancnt length = 8 format = 6. informat = 6.
label = 'ORGTRNCNT';
stop;
run;
%rcSet(&syserr);
%rcSet(&syserr);
%end;
%mend etls_recordCheck;
%etls_recordCheck;
%rcSet(&syserr);
%end;
%mend etls_recordCheck;
%etls_recordCheck;
%mend etls_loader;
%etls_loader;
P23
/*============================================================================*
* Step: SPD Server Loader A55NWR2B.BI00K7NB *
* Transform: SPD Server Table Loader *
* Description: *
* *
* Source Table: Splitter Target 1 - work.W5JR5N1P A55NWR2B.BL00A9LM *
* Target Table: Staging Niche PI -Retained Premium A55NWR2B.BX004XHB *
* Details - dbnchpis.RETPREM_PI *
*============================================================================*/
%let trans_rc = 0;
%global etls_tableExist;
%global etls_numIndex;
%global etls_lastTable;
%let etls_tableExist = -1;
%let etls_numIndex = -1;
%let etls_lastTable = &SYSLAST;
%rcSet(&syserr);
%let etls_tableExist = 0;
data dbnchpis.RETPREM_PI
(label = 'Staging Niche PI -Retained Premium Details');
attrib company length = 8 format = 6. informat = 6.
label = 'Company';
attrib product length = $3 format = $3. informat = $3.
label = 'Product';
attrib policy length = 8 format = 11. informat = 11.
label = 'Policy Number';
attrib itemNo length = 8 format = 6. informat = 6.
label = 'Item No';
attrib trancnt length = 8 format = 6. informat = 6.
label = 'Transaction Count';
attrib retRiPrem length = 8 format = 12.2
label = 'Retained Premium';
attrib qsPrem length = 8 format = 12.2
label = 'Quota Share Premium';
attrib catPrem length = 8 format = 12.2
label = 'Catastrophe Premium';
attrib eolprem length = 8 format = 12.2
label = 'Excess Of Loss Premium';
attrib specPrem length = 8 format = 12.2
label = 'Special Premium';
stop;
run;
%rcSet(&syserr);
data _null_;
set work.etls_contents (obs = 1);
call symput("etls_recordsBefore", left(put(nobs,32.)));
run;
%end;
%mend etls_recordCheck;
%etls_recordCheck;
%let etls_table = %nrquote(Staging Niche PI -Retained Premium Details);
%let etls_lib = %nrquote(Protect Niche PI - Daily Staging Library);
%rcSet(&syserr);
data _null_;
set work.etls_contents (obs = 1);
call symput("etls_recordsAfter", left(put(nobs,32.)));
run;
%end;
%mend etls_recordCheck;
%etls_recordCheck;
%mend etls_loader;
%etls_loader;
P25
/*============================================================================*
* Step: SPD Server Loader A55NWR2B.BI00K7NA *
* Transform: SPD Server Table Loader *
* Description: *
* *
* Source Table: Splitter Target 2 - work.W5JR5N1Z A55NWR2B.BL00A9LN *
%let trans_rc = 0;
%global etls_tableExist;
%global etls_numIndex;
%global etls_lastTable;
%let etls_tableExist = -1;
%let etls_numIndex = -1;
%let etls_lastTable = &SYSLAST;
%rcSet(&syserr);
%let etls_tableExist = 0;
data dbnchpis.COINS_PREM_PI
(label = 'Staging Niche PI - Coinsurance Premium Details');
attrib company length = 8 format = 6. informat = 6.
label = 'Company';
attrib product length = $3 format = $3. informat = $3.
label = 'Product';
attrib policy length = 8 format = 11. informat = 11.
label = 'Policy Number';
attrib itemNo length = 8 format = 6. informat = 6.
label = 'Item No';
attrib trancnt length = 8 format = 6. informat = 6.
label = 'Transaction Count';
attrib coinsPrem length = 8 format = 12.2
label = 'Coinsurance Premium';
stop;
run;
%rcSet(&syserr);
data _null_;
set work.etls_contents (obs = 1);
call symput("etls_recordsBefore", left(put(nobs,32.)));
run;
%rcSet(&syserr);
data _null_;
set work.etls_contents (obs = 1);
call symput("etls_recordsAfter", left(put(nobs,32.)));
run;
%end;
%mend etls_recordCheck;
%etls_recordCheck;
%mend etls_loader;
%etls_loader;
P35
/*============================================================================*
* Step: SPD Server Loader A55NWR2B.BI00K7NG *
%let trans_rc = 0;
%global etls_tableExist;
%global etls_numIndex;
%global etls_lastTable;
%let etls_tableExist = -1;
%let etls_numIndex = -1;
%let etls_lastTable = &SYSLAST;
%rcSet(&syserr);
%let etls_tableExist = 0;
data dbnchpie.ERR_TERM_PI
(label = 'Error PI - Daily Error Terms');
attrib coverageKey length = 8
label = 'Coverage Key';
attrib company length = 3 format = 6. informat = 6.
label = 'Company';
attrib product length = $3 format = $3. informat = $3.
label = 'Product';
attrib class length = $3 format = $3. informat = $3.
label = 'Class';
attrib subclass length = $3 format = $3. informat = $3.
label = 'Subclass';
attrib policy length = 8 format = 11. informat = 11.
label = 'Policy Number';
attrib seqPolicy length = 8 format = 11. informat = 11.
label = 'Sequence Policy Number';
attrib itemNo length = 3 format = 6. informat = 6.
label = 'Item No';
attrib termIdent length = $3
label = 'Term Identification';
attrib trancnt length = 4 format = 6. informat = 6.
label = 'Transaction Count';
attrib orgtrncnt length = 4
label = 'Original Trans Count being Reversed';
attrib reversedTrncnt length = 4
label = 'This trans has been reversed by this Trans Count';
attrib covRenewedDate length = 5 format = DATE9.
label = 'Coverage Renew Date';
%rcSet(&syserr);
%rcSet(&syserr);
data _null_;
set work.etls_contents (obs = 1);
call symput("etls_recordsBefore", left(put(nobs,32.)));
run;
%end;
%mend etls_recordCheck;
%etls_recordCheck;
%rcSet(&syserr);
data _null_;
set work.etls_contents (obs = 1);
call symput("etls_recordsAfter", left(put(nobs,32.)));
run;
%end;
%mend etls_recordCheck;
%etls_recordCheck;
%mend etls_loader;
%etls_loader;
data _null_;
call symput('etls_endTime',put(datetime(),datetime.));
run;
%let etls_etvarnum=%sysfunc(varnum(&dsid,ENDTIME));
%if (&etls_etvarnum gt 0) %then
%let etls_etfmt=%sysfunc(varfmt(&dsid,&etls_etvarnum));
%let rc=%sysfunc(close(&dsid));
%end;
data work.etls_tempData;
user = "&sysuserid";
rbefore = &etls_recordsBefore;
rafter = &etls_recordsAfter;
etl_table = "&etls_table";
lib = "&etls_lib";
jobname = "&etls_jobName";
job_rc = &job_rc;
if job_rc = 0 then
jobstat = "Job Successful";
else if job_rc = 4 then
jobstat = "Job Ended with Warnings";
else if job_rc > 4 then
jobstat = "Job Ended with Errors";
sttime = "&etls_startTime"dt;
endtime = "&etls_endTime"dt;
run;
proc append base=&libref..&dataset data=work.etls_tempData force;
run;
%mend etls_sendJobStatus;
%etls_sendJobStatus
(libref = %str(dbnchpis),
Dataset = %str(ACTBASE_JOB_STATUS));
P03
/*============================================================================*
* Step: Extract_Source_Data_reqdcols A55NWR2B.BI00K7NQ *
* Transform: Extract_Source_Data_reqdcols *
* Description: Process to extract source data & reqd cols *
* *
* Source Table: PNCH_ITEM - dbpncstg.PNCH_ITEM A55NWR2B.BX001CV9 *
* Target Table: Extract_Source_Data_With_TimeStamp_reqdc A55NWR2B.BL00A9M4 *
* ols - spdswork.W66CP32B *
*============================================================================*/
%let trans_rc = 0;
/* Source table(s)/view(s) */
%let _INPUT0 = dbpncstg.PNCH_ITEM;
/* Target table/view(s) */
%let _OUTPUT = spdswork.W66CP32B;
%let _OUTPUT0 = spdswork.W66CP32B;
/* Options */
%let _renameVar = ;
%let Extract = %nrquote(where = %(rec_type_cd NE 3 and %(COMPANY in %(1,2,4,5,11%) OR
%(COMPANY=3 AND
put%(COMPRESS%(product%)||COMPRESS%(class%)||COMPRESS%(subclass%),$CIA_PDS1a.%) NE
%'CI%'%)%) AND PRODUCT NOT IN %(%'QTE%',%'CVN%'%)%));
%MACRO extract_srcdata;
%mend;
%extract_srcdata;
%rcSet(&syserr);
%rcSet(&sysrc);
%rcSet(&sqlrc);
%let trans_rc = 0;
/* Source table(s)/view(s) */
%let _INPUT0 = dbpncstg.PNCH_POLICY;
/* Target table/view(s) */
%let _OUTPUT = spdswork.W66COZ5U;
%let _OUTPUT0 = spdswork.W66COZ5U;
/* Options */
%let _renameVar = ;
%let Extract = %nrquote(where = %(rec_type_cd NE 3 and %(COMPANY in %(1,2,4,5,11%) OR
%(COMPANY=3 AND put%(PRODUCT,$CIA_PDS1a.%) NE %'CI%'%)%) AND PRODUCT NOT IN
%(%'QTE%',%'CVN%'%) AND IMAGEFLAG IN %(%' %',%'I%'%)%));
%MACRO extract_srcdata;
%mend;
%extract_srcdata;
%rcSet(&syserr);
%rcSet(&sysrc);
%rcSet(&sqlrc);
P24
/*============================================================================*
* Step: Extract_Source_Data_reqdcols A55NWR2B.BI00K7NL *
* Transform: Extract_Source_Data_reqdcols *
* Description: Process to extract source data & reqd cols *
* *
* Source Table: PNCH_POLICYTH - dbpncstg.PNCH_POLICYTH A55NWR2B.BX001CW1 *
* Target Table: Extract_Source_Data_With_TimeStamp_reqdc A55NWR2B.BL00A9M0 *
* ols - work.W66CPRB4 *
*============================================================================*/
%let trans_rc = 0;
/* Source table(s)/view(s) */
%let _INPUT0 = dbpncstg.PNCH_POLICYTH;
/* Target table/view(s) */
%let _OUTPUT = work.W66CPRB4;
%let _OUTPUT0 = work.W66CPRB4;
/* Options */
%let _renameVar = ;
%let Extract = %nrquote(where = %(rec_type_cd NE 3 and %(COMPANY in %(1,2,4,5,11%) OR
%(COMPANY=3 AND put%(PRODUCT,$CIA_PDS1a.%) NE %'CI%'%)%) AND PRODUCT NOT IN
%(%'QTE%',%'CVN%'%) AND TRANCNT NE 0 AND ORGTRNCNT NE 0%));
%MACRO extract_srcdata;
%mend;
%extract_srcdata;
%rcSet(&syserr);
%rcSet(&sysrc);
%rcSet(&sqlrc);
SQL Join
P05
/*============================================================================*
* Step: SQL Join A55NWR2B.BI00K7NS *
* Transform: SQL Join (Version 2) *
* Description: *
* *
* Source Tables: User Written Code Target - A55NWR2B.BL00A9M5 *
* spdswork.W5J4C0T7 *
* User Written Code Target - A55NWR2B.BL00A9LT *
* spdswork.W5J583L8 *
* Target Table: SQL Target - spdswork.W5J17JAU A55NWR2B.BL00A9M6 *
*============================================================================*/
%let trans_rc = 0;
%let spdssqlr = ;
proc sql;
create table spdswork.W5J17JAU as
select
W5J4C0T7.COMPANY length = 8
format = 6.
informat = 6.
%macro etls_completeTarget();
%mend etls_completeTarget;
%etls_completeTarget;
P06
/*============================================================================*
* Step: SQL Join A55NWR2B.BI00K7NU *
* Transform: SQL Join (Version 2) *
* Description: *
* *
* Source Tables: User Written Code Target - A55NWR2B.BL00A9M7 *
* spdswork.W5J4DH4Z *
* Staging Niche PI -Retained Premium A55NWR2B.BX004XHB *
* Details - dbnchpis.RETPREM_PI *
* Target Table: SQL Target - spdswork.W66JACO2 A55NWR2B.BL00A9M8 *
*============================================================================*/
%let trans_rc = 0;
%let spdssqlr = ;
proc sql;
create table spdswork.W66JACO2 as
select
W5J4DH4Z.COMPANY length = 8
format = 6.
informat = 6.
label = 'COMPANY',
W5J4DH4Z.PRODUCT length = 3
format = $3.
informat = $3.
label = 'PRODUCT',
W5J4DH4Z.POLICY length = 8
format = 11.
informat = 11.
label = 'POLICY',
W5J4DH4Z.ITEMNO length = 8
format = 6.
informat = 6.
%rcSet(&sqlrc);
%macro etls_completeTarget();
%mend etls_completeTarget;
%etls_completeTarget;
P09
/*============================================================================*
* Step: SQL Join A55NWR2B.BI00K7NX *
* Transform: SQL Join (Version 2) *
* Description: *
* *
* Source Tables: User Written Code Target - A55NWR2B.BL00A9M3 *
* spdswork.W65KH115 *
* Lookup Target - spdswork.W66CQZYW A55NWR2B.BL00A9MA *
* Target Table: SQL Target - spdswork.W65KH0PT A55NWR2B.BL00A9MB *
*============================================================================*/
%let trans_rc = 0;
%let spdssqlr = ;
proc sql;
create table spdswork.W65KH0PT as
select
W66CQZYW.ORGTRNCNT length = 8
format = 6.
informat = 6.
label = 'ORGTRNCNT',
W66CQZYW.ITMSTATUS length = 1
format = $1.
informat = $1.
label = 'Item Status - V(void)/blank(current)',
W66CQZYW.REASONCDE length = 2
format = $2.
informat = $2.
label = 'Reason Code for Cancellation Of Item',
W66CQZYW.itemAtrnType length = 2
format = $2.
informat = $2.
label = 'Item - Transaction Type',
W66CQZYW.incGrossPrem length = 5
format = COMMA12.2
informat = 13.2
label = 'Transaction Basic Premium',
W66CQZYW.incStatutCharges length = 4
format = COMMA10.2
informat = 13.2
label = 'Transaction Charge',
W66CQZYW.stampduty length = 4
format = COMMA10.2
informat = 13.2
%rcSet(&sqlrc);
%macro etls_completeTarget();
%mend etls_completeTarget;
%etls_completeTarget;
P33
/*============================================================================*
* Step: SQL Join A55NWR2B.BI00K7O3 *
* Transform: SQL Join (Version 2) *
* Description: *
* *
* Source Tables: Extract Target - work.W66NJTRK A55NWR2B.BL00A9LZ *
* Splitter Target 2 - spdswork.W66O0OTD A55NWR2B.BL00A9MI *
* Target Table: SQL Target - work.W66O0ZD9 A55NWR2B.BL00A9MK *
*============================================================================*/
proc sql;
create view work.W66O0ZD9 as
select
W66O0OTD.FIREBRIG length = 1
format = $1.
informat = $1.
label = 'FIREBRIG',
W66O0OTD.COYISSUED length = 8
format = 6.
informat = 6.
label = 'COYISSUED',
W66O0OTD.itemNo length = 8
format = 6.
informat = 6.
label = 'Item No',
W66O0OTD.modified length = 8
format = BINARY10.
label = 'Flag to identify User Modifications in Binary
00000000',
W66O0OTD.GRPNAME length = 60
label = 'Group Name',
W66O0OTD.MANCOMRTE length = 8
format = 6.2
informat = 6.2
label = 'MANCOMRTE',
W66O0OTD.POLSTATUS length = 1
format = $1.
informat = $1.
label = 'POLSTATUS',
W66O0OTD.PREMREASA length = 2
format = $2.
informat = $2.
label = 'PREMREASA',
W66O0OTD.inforceIncDate length = 5
format = DATE9.
label = 'In Force Inception Date',
W66O0OTD.incCommission1 length = 4
format = 10.2
informat = 13.2
label = 'Transaction Commission',
W66O0OTD.RCOMMISN length = 8
format = 13.2
informat = 13.2
label = 'RCOMMISN',
W66O0OTD.incGrossPrem length = 5
format = 12.2
informat = 13.2
label = 'Transaction Basic Premium',
W66O0OTD.reverseTrncnt length = 8
format = 6.
informat = 6.
label = 'Transaction Count',
W66O0OTD.BRCHRESP length = 8
format = 6.
informat = 6.
label = 'BRCHRESP',
W66O0OTD.CUSTREF length = 14
format = $14.
informat = $14.
label = 'CUSTREF',
W66O0OTD.LOCKUSER length = 8
format = $8.
informat = $8.
label = 'LOCKUSER',
W66O0OTD.CITY length = 40
format = $40.
informat = $40.
label = 'City/Town/Suburb Name',
W66O0OTD.covRenewedDate length = 5
format = DATE9.
label = 'Coverage Renew Date',
W66O0OTD.incCommGst length = 4
format = 10.2
informat = 13.2
label = 'Amount of GST on Transaction Commision',
W66O0OTD.OCCUPATN length = 4
format = $4.
%rcSet(&sqlrc);
P34
/*============================================================================*
* Step: SQL Join A55NWR2B.BI00K7O4 *
* Transform: SQL Join (Version 2) *
* Description: *
* *
* Source Tables: Extract Target - work.W667ICOF A55NWR2B.BL00A9M2 *
* SQL Target - work.W66O0ZD9 A55NWR2B.BL00A9MK *
* Target Table: SQL Target - work.W66O108F A55NWR2B.BL00A9ML *
*============================================================================*/
%let trans_rc = 0;
proc sql;
create table work.W66O108F as
select
W66O0ZD9.FIREBRIG length = 1
format = $1.
informat = $1.
label = 'FIREBRIG',
W66O0ZD9.COYISSUED length = 8
format = 6.
informat = 6.
label = 'COYISSUED',
W66O0ZD9.itemNo length = 8
format = 6.
informat = 6.
label = 'Item No',
W66O0ZD9.modified length = 8
format = BINARY10.
label = 'Flag to identify User Modifications in Binary
00000000',
W66O0ZD9.GRPNAME length = 60
label = 'Group Name',
W66O0ZD9.MANCOMRTE length = 8
format = 6.2
informat = 6.2
label = 'MANCOMRTE',
W66O0ZD9.POLSTATUS length = 1
format = $1.
informat = $1.
label = 'POLSTATUS',
W66O0ZD9.PREMREASA length = 2
format = $2.
informat = $2.
label = 'PREMREASA',
W66O0ZD9.inforceIncDate length = 5
format = DATE9.
label = 'In Force Inception Date',
W66O0ZD9.incCommission1 length = 4
format = 10.2
%rcSet(&sqlrc);
%macro etls_completeTarget();
%mend etls_completeTarget;
%etls_completeTarget;
Lookup
P07
/*============================================================================*
* Step: Lookup A55NWR2B.BI00K7NV *
* Transform: Lookup *
* Description: *
* *
* Source Tables: Staging Niche PI - Coinsurance Premium A55NWR2B.BX004XH3 *
* Details - dbnchpis.COINS_PREM_PI *
* SQL Target - spdswork.W66JACO2 A55NWR2B.BL00A9M8 *
* Extract_Source_Data_With_TimeStamp_reqdc A55NWR2B.BL00A9M0 *
* ols - work.W66CPRB4 *
* Target Table: Lookup Target - work.W66IWKTU A55NWR2B.BL00A9M9 *
*============================================================================*/
/* make the runTime macro variable to store the run time of the job */
retain missing0-missing1 0;
/* Build hash objects from lookup tables before reading first source row */
if (_n_ = 1) then
do;
/* Build hash h0 from lookup table work.W66CPRB4 */
nlobs = .;
dsid = open("work.W66CPRB4");
if (dsid > 0) then
do;
if ( attrc(dsid, 'MTYPE') = 'DATA' ) then
nlobs = attrn(dsid, 'NLOBS');
else
nlobs = -1;
dsid = close(dsid);
if (nlobs ^= 0) then
do;
if (nlobs > 0) then
exponent = ceil(log2(nlobs));
else
exponent = 8;
declare hash h0(dataset: "work.W66CPRB4", hashexp: exponent);
h0.defineKey( "COMPANY",
"PRODUCT",
"POLICY",
"TRANCNT");
h0.defineData( "ORGTRNCNT");
h0.defineDone();
if (nlobs = -1) then
do;
if (h0.Num_Items < 1) then
do;
put "NOTE: Lookup table is empty: work.W66CPRB4";
put "NOTE: Abort action indicated, condition= Lookup table is empty:"
abort 3;
end;
end;
end;
else
do;
put "NOTE: Lookup table is empty: work.W66CPRB4";
put "NOTE: Abort action indicated, condition= Lookup table is empty:"
" work.W66CPRB4";
abort 3;
end;
end;
else
do;
put "NOTE: Lookup table does not exist or cannot be opened: work.W66CPRB4";
abort 3;
end;
dsid = close(dsid);
if (nlobs ^= 0) then
do;
if (nlobs > 0) then
exponent = ceil(log2(nlobs));
else
exponent = 8;
declare hash h1(dataset: "dbnchpis.COINS_PREM_PI", hashexp: exponent);
h1.defineKey( "company",
"product",
"policy",
"itemNo",
"trancnt");
h1.defineData( "coinsPrem");
h1.defineDone();
if (nlobs = -1) then
do;
if (h1.Num_Items < 1) then
do;
put "NOTE: Lookup table is empty: dbnchpis.COINS_PREM_PI";
missing1 = 98;
end;
end;
end;
else
do;
put "NOTE: Lookup table is empty: dbnchpis.COINS_PREM_PI";
missing1 = 98;
end;
end;
else
do;
put "NOTE: Lookup table does not exist or cannot be opened:"
" dbnchpis.COINS_PREM_PI";
abort 3;
end;
call missing (COMPANY, PRODUCT, POLICY, TRANCNT, ORGTRNCNT, company,
product, policy, itemNo, trancnt, coinsPrem);
if (rc0 ^= 0) then
do;
exception_total + 1;
/* Check: Lookup value not found-Set target columns to missing */
call missing (ORGTRNCNT);
request_write_target = 1;
end;
if (rc1 ^= 0) then
do;
exception_total + 1;
if (rc1 = 98) then
do;
/* Check: Lookup table has no rows-Write exception row */
/* Check: Lookup table has no rows-Set target columns to value */
/* Check: Lookup table has no rows-Set target columns to missing */
call missing (coinsPrem);
request_write_target = 1;
end;
else
do;
/* Check: Lookup value not found-Set target columns to missing */
call missing (coinsPrem);
request_write_target = 1;
end;
end;
if (eof = 1) then
do;
put "Source records with errors: " error_total ;
put "Total lookup exceptions: " exception_total ;
end;
run;
%rcSet(&syserr);
P08
/*============================================================================*
* Step: Lookup A55NWR2B.BI00K7NW *
* Transform: Lookup *
* Description: *
* *
%let trans_rc = 0;
/* make the runTime macro variable to store the run time of the job */
%let runTime = %sysfunc(datetime(), );
retain missing0-missing0 0;
/* Build hash objects from lookup tables before reading first source row */
if (_n_ = 1) then
do;
/* Build hash h0 from lookup table work.W5J1AM3C */
nlobs = .;
dsid = open("work.W5J1AM3C");
if (dsid > 0) then
do;
if ( attrc(dsid, 'MTYPE') = 'DATA' ) then
nlobs = attrn(dsid, 'NLOBS');
else
nlobs = -1;
dsid = close(dsid);
if (nlobs ^= 0) then
do;
if (nlobs > 0) then
exponent = ceil(log2(nlobs));
else
abort 3;
end;
if (rc0 ^= 0) then
do;
exception_total + 1;
if (rc0 = 98) then
do;
/* Check: Lookup table has no rows-Write exception row */
/* Check: Lookup table has no rows-Set target columns to value */
/* Check: Lookup table has no rows-Set target columns to missing */
call missing (premtranTRANDATE, TRANTIME, premtranTbasicPrm,
ATRNTYPE);
request_write_target = 1;
end;
else
do;
if (eof = 1) then
do;
put "Source records with errors: " error_total ;
put "Total lookup exceptions: " exception_total ;
end;
run;
%rcSet(&syserr);
data spdswork.W66CQZYW;
set work.mapped;
run;
P10
/*============================================================================*
* Step: Lookup A55NWR2B.BI00K7NY *
* Transform: Lookup *
* Description: *
* *
* Source Tables: SQL Target - spdswork.W65KH0PT A55NWR2B.BL00A9MB *
* Extract Target - work.W65KIXJX A55NWR2B.BL00A9MC *
* Target Table: Lookup Target - work.W66GB66B A55NWR2B.BL00A9MD *
*============================================================================*/
%let transformID = %quote(A55NWR2B.BI00K7NY);
%let trans_rc = 0;
retain missing0-missing0 0;
/* Build hash objects from lookup tables before reading first source row */
if (_n_ = 1) then
do;
/* Build hash h0 from lookup table work.W65KIXJX */
nlobs = .;
dsid = open("work.W65KIXJX");
if (dsid > 0) then
do;
if ( attrc(dsid, 'MTYPE') = 'DATA' ) then
nlobs = attrn(dsid, 'NLOBS');
else
nlobs = -1;
dsid = close(dsid);
if (nlobs ^= 0) then
abort 3;
end;
end;
end;
else
do;
put "NOTE: Lookup table is empty: work.W65KIXJX";
put "NOTE: Abort action indicated, condition= Lookup table is empty:"
" work.W65KIXJX";
abort 3;
end;
end;
else
do;
put "NOTE: Lookup table does not exist or cannot be opened: work.W65KIXJX";
abort 3;
end;
if (rc0 ^= 0) then
do;
exception_total + 1;
/* Check: Lookup value not found-Set target columns to missing */
call missing (POSTCODE, CITY);
request_write_target = 1;
end;
if (eof = 1) then
do;
run;
%rcSet(&syserr);
P13
/*============================================================================*
* Step: Lookup A55NWR2B.BI00K7O0 *
* Transform: Lookup *
* Description: *
* *
* Source Tables: Splitter Target 1 - work.W5JEMGHC A55NWR2B.BL00A9ME *
* Staging Niche PI - Reversed Transactions A55NWR2B.BX004XHA *
* - dbnchpis.REVERSETRANS_PI *
* AUTINDEX - work.W667HQLA A55NWR2B.BL00A9M1 *
* AGENT - work.W667I7NC A55NWR2B.BL00A9LX *
* Target Table: Lookup Target - spdswork.W5JEML2D A55NWR2B.BL00A9MF *
*============================================================================*/
%let trans_rc = 0;
/* make the runTime macro variable to store the run time of the job */
%let runTime = %sysfunc(datetime(), );
retain missing0-missing2 0;
/* Build hash objects from lookup tables before reading first source row */
if (_n_ = 1) then
do;
/* Build hash h0 from lookup table dbnchpis.REVERSETRANS_PI */
nlobs = .;
dsid = open("dbnchpis.REVERSETRANS_PI");
if (dsid > 0) then
do;
if ( attrc(dsid, 'MTYPE') = 'DATA' ) then
nlobs = attrn(dsid, 'NLOBS');
else
nlobs = -1;
dsid = close(dsid);
if (nlobs ^= 0) then
do;
if (nlobs > 0) then
exponent = ceil(log2(nlobs));
else
exponent = 8;
declare hash h0(dataset: "dbnchpis.REVERSETRANS_PI", hashexp: exponent);
h0.defineKey( "COMPANY",
"PRODUCT",
"POLICY",
"ITEMNO",
"trancnt");
h0.defineData( "reverseTrncnt");
h0.defineDone();
if (nlobs = -1) then
do;
if (h0.Num_Items < 1) then
do;
put "NOTE: Lookup table is empty: dbnchpis.REVERSETRANS_PI";
missing0 = 98;
end;
end;
end;
else
do;
put "NOTE: Lookup table is empty: dbnchpis.REVERSETRANS_PI";
missing0 = 98;
end;
end;
else
do;
put "NOTE: Lookup table does not exist or cannot be opened:"
" dbnchpis.REVERSETRANS_PI";
abort 3;
end;
dsid = close(dsid);
if (nlobs ^= 0) then
do;
if (nlobs > 0) then
exponent = ceil(log2(nlobs));
else
exponent = 8;
declare hash h1(dataset: "work.W667HQLA", hashexp: exponent);
h1.defineKey( "COMPANY",
"PRODUCT",
"STATE",
"CLASS",
"SUBCLASS");
h1.defineData( "INDEXPERC");
h1.defineDone();
if (nlobs = -1) then
do;
if (h1.Num_Items < 1) then
do;
put "NOTE: Lookup table is empty: work.W667HQLA";
put "NOTE: Abort action indicated, condition= Lookup table is empty:"
" work.W667HQLA";
abort 3;
end;
end;
end;
else
do;
put "NOTE: Lookup table is empty: work.W667HQLA";
put "NOTE: Abort action indicated, condition= Lookup table is empty:"
" work.W667HQLA";
abort 3;
end;
end;
else
do;
put "NOTE: Lookup table does not exist or cannot be opened: work.W667HQLA";
abort 3;
end;
dsid = close(dsid);
if (nlobs ^= 0) then
do;
if (nlobs > 0) then
exponent = ceil(log2(nlobs));
else
exponent = 8;
declare hash h2(dataset: "work.W667I7NC", hashexp: exponent);
h2.defineKey( "AGENT",
"COMPANY");
h2.defineData( "COMSCALE",
"AGTGROUP",
"GRPNAME",
"AGTCLUSTR",
"AGENTSTATE");
h2.defineDone();
if (nlobs = -1) then
do;
if (h2.Num_Items < 1) then
do;
put "NOTE: Lookup table is empty: work.W667I7NC";
abort 3;
end;
end;
end;
else
do;
put "NOTE: Lookup table is empty: work.W667I7NC";
put "NOTE: Abort action indicated, condition= Lookup table is empty:"
" work.W667I7NC";
abort 3;
end;
end;
else
do;
put "NOTE: Lookup table does not exist or cannot be opened: work.W667I7NC";
abort 3;
end;
if (rc0 ^= 0) then
do;
exception_total + 1;
if (rc0 = 98) then
do;
/* Check: Lookup table has no rows-Write exception row */
/* Check: Lookup table has no rows-Set target columns to value */
reverseTrncnt = 0;
request_write_target = 1;
end;
else
do;
/* Check: Lookup value not found-Set target columns to value */
reverseTrncnt = 0;
request_write_target = 1;
end;
end;
if (rc2 ^= 0) then
do;
exception_total + 1;
/* Check: Lookup value not found-Set target columns to missing */
call missing (COMSCALE, AGTGROUP, GRPNAME, AGTCLUSTR, AGENTSTATE);
request_write_target = 1;
end;
if (eof = 1) then
do;
put "Source records with errors: " error_total ;
put "Total lookup exceptions: " exception_total ;
end;
run;
%rcSet(&syserr);
P30
/*============================================================================*
* Step: Lookup A55NWR2B.BI00K7NF *
* Transform: Lookup *
* Description: *
* *
* Source Tables: Extract Target - work.W667HY6U A55NWR2B.BL00A9LW *
* AGTGRP - work.W667I6HD A55NWR2B.BL00A9LP *
* Target Table: AGENT - work.W667I7NC A55NWR2B.BL00A9LX *
*============================================================================*/
%let trans_rc = 0;
/* make the runTime macro variable to store the run time of the job */
%let runTime = %sysfunc(datetime(), );
retain missing0-missing0 0;
/* Build hash objects from lookup tables before reading first source row */
if (_n_ = 1) then
do;
/* Build hash h0 from lookup table work.W667I6HD */
nlobs = .;
dsid = open("work.W667I6HD");
if (dsid > 0) then
do;
if ( attrc(dsid, 'MTYPE') = 'DATA' ) then
nlobs = attrn(dsid, 'NLOBS');
else
nlobs = -1;
dsid = close(dsid);
if (nlobs ^= 0) then
do;
if (nlobs > 0) then
exponent = ceil(log2(nlobs));
else
exponent = 8;
declare hash h0(dataset: "work.W667I6HD", hashexp: exponent);
h0.defineKey( "AGTGROUP");
h0.defineData( "GRPNAME",
"AGTCLUSTR");
h0.defineDone();
if (nlobs = -1) then
do;
if (h0.Num_Items < 1) then
do;
put "NOTE: Lookup table is empty: work.W667I6HD";
put "NOTE: Abort action indicated, condition= Lookup table is empty:"
abort 3;
end;
end;
end;
else
do;
put "NOTE: Lookup table is empty: work.W667I6HD";
put "NOTE: Abort action indicated, condition= Lookup table is empty:"
" work.W667I6HD";
abort 3;
end;
end;
else
do;
put "NOTE: Lookup table does not exist or cannot be opened: work.W667I6HD";
abort 3;
end;
if (rc0 ^= 0) then
do;
exception_total + 1;
/* Check: Lookup value not found-Set target columns to missing */
call missing (GRPNAME, AGTCLUSTR);
request_write_target = 1;
end;
if (eof = 1) then
do;
put "Source records with errors: " error_total ;
put "Total lookup exceptions: " exception_total ;
end;
run;
%rcSet(&syserr);
data work.W667I7NC;
set work.mapped;
run;
SAS Splitter
P11
/*============================================================================*
* Step: SAS Splitter A55NWR2B.BI00K7NZ *
* Transform: SAS Splitter *
* Description: *
* *
* Source Table: Lookup Target - work.W66GB66B A55NWR2B.BL00A9MD *
* Target Tables: Splitter Target 1 - work.W5JEMGHC A55NWR2B.BL00A9ME *
* Splitter Target 2 - work.W5JEMGHM A55NWR2B.BL00A9LO *
*============================================================================*/
%let trans_rc = 0;
data work.W5JEMGHC
work.W5JEMGHM;
set &SYSLAST;
output work.W5JEMGHC;
if ORGTRNCNT NE 0 & ATRNTYPE = 'RV' then
output work.W5JEMGHM;
run;
%rcSet(&syserr);
data work.W5JEMGHM;
set work.etls_mapped;
run;
P14
/*============================================================================*
* Step: SAS Splitter A55NWR2B.BI00K7O1 *
* Transform: SAS Splitter *
* Description: *
* *
* Source Table: MAIN - spdswork.W5J4GJL1 A55NWR2B.BL00A9MG *
* Target Tables: Splitter Target 1 - work.W66O0OT3 A55NWR2B.BL00A9MH *
* Splitter Target 2 - spdswork.W66O0OTD A55NWR2B.BL00A9MI *
*============================================================================*/
%let trans_rc = 0;
data work.W66O0OT3
spdswork.W66O0OTD;
set &SYSLAST;
if company not in (3, 5) then
output work.W66O0OT3;
if company in (3, 5) then
output spdswork.W66O0OTD;
run;
%rcSet(&syserr);
P17
/*============================================================================*
* Step: SAS Splitter A55NWR2B.BI00K7O6 *
* Transform: SAS Splitter *
* Description: *
* *
* Source Table: AppendWorkTableName - work.W66O2F0P A55NWR2B.BL00A9MM *
* Target Tables: SAS Splitter - work.W5KIDKRW A55NWR2B.BL00A9MN *
* SAS Splitter - work.W5KIDFJ3 A55NWR2B.BL00A9MO *
* SAS Splitter - work.W5KIDI12 A55NWR2B.BL00A9MP *
* SAS Splitter - work.W5JTEW9L A55NWR2B.BL00A9LY *
*============================================================================*/
%let trans_rc = 0;
data work.W5KIDKRW
work.W5KIDFJ3
work.W5KIDI12
work.W5JTEW9L;
set &SYSLAST;
if product NOT IN ('QTE','CVN') AND covChgEffDate >= covRenewedDate then
output work.W5KIDKRW;
if product NOT IN ('QTE','CVN') then
output work.W5KIDFJ3;
if product NOT IN ('QTE','CVN') then
output work.W5KIDI12;
if product NOT IN ('QTE','CVN') AND covChgEffDate < covRenewedDate then
output work.W5JTEW9L;
run;
P22
/*============================================================================*
* Step: SAS Splitter A55NWR2B.BI00K7N5 *
* Transform: SAS Splitter *
* Description: *
* *
* Source Table: Extract Target - work.W5JR5REU A55NWR2B.BL00A9LL *
* Target Tables: Splitter Target 1 - work.W5JR5N1P A55NWR2B.BL00A9LM *
* Splitter Target 2 - work.W5JR5N1Z A55NWR2B.BL00A9LN *
*============================================================================*/
%let trans_rc = 0;
data work.W5JR5N1P
work.W5JR5N1Z;
set &SYSLAST;
if RITYPE ='R' then
output work.W5JR5N1P;
if RITYPE = 'P' then
output work.W5JR5N1Z;
run;
%rcSet(&syserr);
data work.W5JR5N1Z;
set work.etls_mapped;
run;
Append
P16
/*============================================================================*
* Step: Append A55NWR2B.BI00K7O5 *
* Transform: Append *
* Description: *
* *
* Source Tables: SQL Target - work.W66O108F A55NWR2B.BL00A9ML *
* Extract Target - work.W66O1GOS A55NWR2B.BL00A9MJ *
* Target Table: AppendWorkTableName - work.W66O2F0P A55NWR2B.BL00A9MM *
%let trans_rc = 0;
%rcSet(&syserr);
Table Loader
P18
/*============================================================================*
* Step: Table Loader A55NWR2B.BI00K7O8 *
* Transform: Table Loader (Version 2) *
* Description: *
* *
* Source Table: SAS Splitter - work.W5KIDKRW A55NWR2B.BL00A9MN *
* Target Table: Protect Niche PI - Daily Policy Movement A55NWR2B.BX004XI5 *
* - dbnchpip.PMOV_PI *
*============================================================================*/
%let trans_rc = 0;
%global etls_tableExist;
%global etls_numIndex;
%global etls_lastTable;
%let etls_tableExist = -1;
%let etls_numIndex = -1;
%let etls_lastTable = &SYSLAST;
%let SYSOPT = ;
data _null_;
set work.etls_contents (obs = 1);
call symput("etls_recordsBefore", left(put(nobs,32.)));
run;
%end;
%mend etls_recordCheck;
%etls_recordCheck;
%rcSet(&syserr);
%let etls_tableExist = 0;
%rcSet(&syserr);
%rcSet(&syserr);
%rcSet(&syserr);
data _null_;
set work.etls_contents (obs = 1);
call symput("etls_recordsAfter", left(put(nobs,32.)));
run;
%end;
%mend etls_recordCheck;
%etls_recordCheck;
%mend etls_loader;
%etls_loader;
P36
/*============================================================================*
* Step: Table Loader A55NWR2B.BI00K7O7 *
* Transform: Table Loader (Version 2) *
* Description: *
* *
* Source Table: SAS Splitter - work.W5KIDI12 A55NWR2B.BL00A9MP *
* Target Table: Staging Niche PI - Generic Daily A55NWR2B.BX004XH2 *
* Coverage Details - *
* dbnchpis.COVDTLS_PI_STG *
*============================================================================*/
%let trans_rc = 0;
%global etls_tableExist;
%global etls_numIndex;
%global etls_lastTable;
%let etls_tableExist = -1;
%let etls_numIndex = -1;
%let etls_lastTable = &SYSLAST;
%let SYSOPT = ;
data _null_;
set work.etls_contents (obs = 1);
call symput("etls_recordsBefore", left(put(nobs,32.)));
run;
%end;
%mend etls_recordCheck;
%etls_recordCheck;
%let etls_table = %nrquote(Staging Niche PI - Generic Daily Coverage Details);
%let etls_lib = %nrquote(Protect Niche PI - Daily Staging Library);
%rcSet(&syserr);
%let etls_tableExist = 0;
%rcSet(&syserr);
%rcSet(&syserr);
%rcSet(&syserr);
data _null_;
set work.etls_contents (obs = 1);
call symput("etls_recordsAfter", left(put(nobs,32.)));
run;
%end;
%mend etls_recordCheck;
%etls_recordCheck;
%mend etls_loader;
%etls_loader;
P37
/*============================================================================*
* Step: NOT USED A55NWR2B.BI00K7O9 *
* Transform: Table Loader (Version 2) *
* Description: *
* *
* Source Table: SAS Splitter - work.W5KIDFJ3 A55NWR2B.BL00A9MO *
* Target Table: Protect Niche PI - Daily Master Key - A55NWR2B.BX004XI4 *
* dbnchpip.MASTERKEY_PI *
* *
* User Written: NOT USED A55NWR2B.AF00OCOP *
*============================================================================*/
/* Access the data for Protect Niche PI - Daily Base Layer PreLive Library */
LIBNAME dbnchpip SASSPDS GROUP='production' user="&uid" passwd = "&pw"
schema="D_B_PNCHPI_PRELIVE" HOST='sasap2' Serv='5090' ;
%rcSet(&syslibrc);
%let trans_rc = 0;
%rcSet(&syserr);
%rcSet(&sqlrc);
P20
/*============================================================================*
* Step: User Define Summary Statistics A55NWR2B.BI00K7NK *
* Transform: User Define Summary Statistics *
* Description: User Define Summary Statistics *
* *
%let trans_rc = 0;
/* Source table(s)/view(s) */
%let _INPUT0 = dbpncstg.PNCH_PREMTRAN;
/* Target table/view(s) */
%let _OUTPUT = spdswork.W5J1AN5G;
%let _OUTPUT0 = spdswork.W5J1AN5G;
/* Options */
%let options = ;
%let noprint = ;
%let outputOptions = ;
%let procOptions = %nrquote(NWAY MISSING);
%let statistics = %nrquote(SUM);
%let ClassColumns = COMPANY PRODUCT POLICY ITEMNO TRANCNT TRANDATE;
%let idColumns = TRANTIME ATRNTYPE;
%let whereEqual = %nrquote(where = %(rec_type_cd NE 3 and %(COMPANY in %(1,2,4,5,11%) OR
%(COMPANY=3 AND
put%(COMPRESS%(product%)||COMPRESS%(class%)||COMPRESS%(subclass%),$CIA_PDS1a.%) NE
%'CI%'%)%) AND PRODUCT NOT IN %(%'QTE%',%'CVN%'%)%));
%let VarColumns = TBASICPRM;
options mprint;
%let stat=;
%let count=0;
%do %until (%quote(&stat) eq);
%let count=%eval(&count + 1);
%let stat=%scan(%quote(&statistics), &count, %quote( ));
%if (%quote(&stat) ne) %then
%do;
&stat=
run;
%RCSET(&syserr);
%mend SummaryTable;
%SummaryTable;
%rcSet(&syserr);
%rcSet(&sysrc);
%rcSet(&sqlrc);
P26
/*============================================================================*
* Step: User Written Code A55NWR2B.BI00K7NN *
* Transform: User Written Code *
* Description: *
* *
* Source Table: PNCH_AGENT - dbpncstg.PNCH_AGENT A55NWR2B.BX001CTT *
* Target Table: User Written Code Target - work.W667HWHQ A55NWR2B.BL00A9LV *
* *
* User Written: agent lookup A55NWR2B.AF00OCKA *
* agent lookup *
*============================================================================*/
%let trans_rc = 0;
*** Only take the last record for each maintenance ***;
DATA &_OUTPUT.;
SET &SYSLAST.;
BY md5_key row_effective_dt rec_type_cd;
IF last.md5_key AND rec_type_cd NE 3;
RUN;
%rcSet(&syserr);
%rcSet(&sqlrc);