This document describes a job to create a one-off extract of weekly and daily data from a historical database for a daily increment process. It defines library references and macro variables needed for the extract job. The job will copy PMOV data from a full load Actuarial Base Layer job into daily, weekly, and monthly libraries after processing for those time periods.
This document describes a job to create a one-off extract of weekly and daily data from a historical database for a daily increment process. It defines library references and macro variables needed for the extract job. The job will copy PMOV data from a full load Actuarial Base Layer job into daily, weekly, and monthly libraries after processing for those time periods.
This document describes a job to create a one-off extract of weekly and daily data from a historical database for a daily increment process. It defines library references and macro variables needed for the extract job. The job will copy PMOV data from a full load Actuarial Base Layer job into daily, weekly, and monthly libraries after processing for those time periods.
This document describes a job to create a one-off extract of weekly and daily data from a historical database for a daily increment process. It defines library references and macro variables needed for the extract job. The job will copy PMOV data from a full load Actuarial Base Layer job into daily, weekly, and monthly libraries after processing for those time periods.
*** Gl component keep variables ***; %LET keepoglentity = trandate level company subcoy state branch product class su bclass agtacctyp rep _activfrom _activto OGLENTITY; %LET keepoglcentre = trandate level company subcoy state branch product class su bclass agtacctyp rep _activfrom _activto OGLCENTRE; %LET keepoglcatgory = trandate level company subcoy state branch product class s ubclass agtacctyp rep _activfrom _activto OGLCATGORY; %LET keepoglstate = trandate level company subcoy state branch product class sub class agtacctyp rep _activfrom _activto OGLSTATE; %LET keepoglproduct = trandate level company subcoy state branch product class s ubclass agtacctyp rep _activfrom _activto OGLPRODUCT; %LET keepoglclass = trandate level company subcoy state branch product class sub class agtacctyp rep _activfrom _activto OGLCLASS; %LET keepoglchannel = trandate level company subcoy state branch product class s ubclass agtacctyp rep _activfrom _activto OGLCHANNEL; %LET keepoglproject = trandate level company subcoy state branch product class s ubclass agtacctyp rep _activfrom _activto OGLPROJECT; %LET keepoglintrcoy = trandate level company subcoy state branch product class s ubclass agtacctyp rep _activfrom _activto OGLINTRCOY; %LET keepoglspare = trandate level company subcoy state branch product class sub class agtacctyp rep _activfrom _activto OGLSPARE;
*** if you rerun CF for whatever reason after the 10th of the month ...; *** you will have to modify the runday macro variable for finshdt to refer to th e previous month ***; %LET runday = 10; %GLOBAL finshdt; DATA _NULL_; IF DAY("&SYSDATE."d) > &runday. THEN CALL SYMPUT('finshdt',INTNX('MONTH',"&SY SDATE."d,0,'E')); ELSE CALL SYMPUT('finshdt',INTNX('MONTH',"&SYSDATE."d,-1,'E')); RUN;
/* macro to convert date fields into SAS Date fomat */ %MACRO convertdate(_indate,_outdate); &_outdate. = INPUT(PUT(&_indate,8.) ,?? YYMMDD8.); %MEND;
/* DI studio generate codes that are longer than 256 chars might cause problem s o substitute with macro instead */ %LET caseexp_modified = CASE WHEN (INTCK('DAY',covRenewedDate,covChgEffDate) IN (365,366) AND itemAtrnType = 'CN') THEN (modified + 4) WHEN (INTCK('DAY',covRenewedDate,covChgEffDate) IN (365,366) AND itemAtrnTy pe = 'LP') THEN (modified + 2) WHEN (INTCK('DAY',covRenewedDate,covChgEffDate) IN (365,366) AND itemAtrnTy pe = ' ') THEN (modified + 32) ELSE modified END ; /*---- End of Pre-Process Code ----*/ %rcSet(&syserr); %rcSet(&sqlrc); /* Create a copy of PMOV in Daily, Weekly and Monthly Library after the full loa d Actuarial Base Layer was run */ OPTIONS FULLSTIMER MSGLEVEL=I; %LET COMPRESS = YES; %LET SPDSDCMP = YES; %LET SPDSIASY = YES; %MACRO libdef; LIBNAME hbpnchpl SASSPDS GROUP="&envSPDS." user="&uid" passwd = "& pw" schema="M_B_PNCH_QLD_CTP_PRELIVE_HIST" server=&spdshost..5090; LIBNAME hbpnch SASSPDS GROUP="&envSPDS." user="&uid" passwd = "& pw" schema="M_B_PNCH_QLD_CTP_HIST" server=&spdshost..5090; LIBNAME hbpncstg SASSPDS GROUP="&envSPDS." user="&uid" passwd = "& pw" schema="M_B_PNCH_QLD_CTP_STAGING_HIST" server=&spdshost..5090; LIBNAME mbpnch SASSPDS GROUP="&envSPDS." user="&uid" passwd = "& pw" schema="M_B_PNCH_QLD_CTP" server=&spdshost..5090; LIBNAME mbpnchpl SASSPDS GROUP="&envSPDS." user="&uid" passwd = "& pw" schema="M_B_PNCH_QLD_CTP_PRELIVE" server=&spdshost..5090; LIBNAME wbpnch SASSPDS GROUP="&envSPDS." user="&uid" passwd = "& pw" schema="W_B_PNCH_QLD_CTP" server=&spdshost..5090; LIBNAME wbpnchpl SASSPDS GROUP="&envSPDS." user="&uid" passwd = "& pw" schema="W_B_PNCH_QLD_CTP_PRELIVE" server=&spdshost..5090; LIBNAME dbpnch SASSPDS GROUP="&envSPDS." user="&uid" passwd = "& pw" schema="D_B_PNCH_QLD_CTP" server=&spdshost..5090; LIBNAME dbpnchpl SASSPDS GROUP="&envSPDS." user="&uid" passwd = "& pw" schema="D_B_PNCH_QLD_CTP_PRELIVE" server=&spdshost..5090; LIBNAME dbnchpis SASSPDS GROUP="&envSPDS." user="&uid" passwd = "&pw" s chema="D_B_PNCH_QLD_CTP_STAGING" server=&spdshost..5090 ; LIBNAME pnchfmt "&mdpath./SASFormats/PROTECT_NICHE"; %MEND; /* Clean up library */ %MACRO cleanup (_lib); PROC DATASETS LIBRARY=&_lib. NOLIST; DELETE PMOV_QLD_CTP; QUIT; %MEND; %MACRO mainCopy; %LET db = dbpnch; %LET wb = wbpnch; %LET mb = mbpnch; %LET hb = hbpnch; %LET hbpl = hbpnchpl; %LET hbst = hbpncstg; %LET dbst = dbnchpis; %LET mbpl = mbpnchpl; /*PRELIVE to LIVE HISTORY*/ PROC COPY IN=&hbpl. OUT=&hb. INDEX=YES; SELECT PMOV_QLD_CTP MASTERKEY_QLD_CTP; RUN; PROC DATASETS LIB = &hb. NOLIST; MODIFY PMOV_QLD_CTP; INDEX DELETE _ALL_; index create key1 = (coverageKey row_insert_dt)/ unique nomiss ; index create policyno ; QUIT; /*HISTORY TO MONTHLY 8 years of data */ PROC COPY IN=&hb. OUT=&mb. INDEX=YES; SELECT PMOV_QLD_CTP MASTERKEY_QLD_CTP; RUN; PROC COPY IN=&hb. OUT=&mbpl. INDEX=YES; SELECT PMOV_QLD_CTP ; RUN; /*HISTORY to DAILY 2 weeks data*/ proc sort data=&hb..PMOV_QLD_CTP(WHERE=(covRenewedDate >= INTNX('WEEK',"&SYSDATE ."d,-2))) out=&db..PMOV_QLD_CTP ; BY company policyno product class subclass itemno trancount; run; PROC DATASETS LIB = &db. NOLIST; MODIFY PMOV_QLD_CTP; index delete _all_; index create coverageKey / unique nomiss ; index create policyno; QUIT; /* proc sort data=&hbst..covdtls_pi(WHERE=(covRenewedDate >= INTNX('WEEK',"&SYSDATE ."d,-2))) out=&dbst..covdtls_pi ; BY company policy product class subclass itemno trancount; run; PROC DATASETS LIB = &dbst. NOLIST; MODIFY covdtls_pi; index create coverageKey ; QUIT; */ /*HISTORY to WEEKLY 2 years of data*/ proc sort data=&hb..PMOV_QLD_CTP(WHERE=(covRenewedDate >= INTNX('YEAR',"&SYSDATE ."d,-2))) out=&wb..PMOV_QLD_CTP ; BY company policyno product class subclass itemno trancount; run; PROC DATASETS LIB = &wb. NOLIST; MODIFY PMOV_QLD_CTP; index delete _all_; index create coverageKey / unique nomiss ; index create policyno; QUIT; %MEND; %libdef; *%cleanup(mbpnchpl); /* Monthly Library Prelive */ %cleanup(hbpnch); /* History Library */ *%cleanup(dbpncstg); /* Daily Staging Library */ *%cleanup(dbpnch); /* Daily Library */ %cleanup(dbpnchpl); /* Daily Library Prelive */ *%cleanup(wbpncstg); /* Weekly Staging Library */ *%cleanup(wbpnch); /* Weeky Library */ %cleanup(wbpnchpl); /* Weekly Library Prelive */ %mainCopy; %rcSet(&syserr); %rcSet(&sqlrc); %let etls_endTime = %sysfunc(datetime(),datetime.);