<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: getting error while running code in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821412#M34913</link>
    <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/378510"&gt;@aanan1417&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;maybe this is woth a try:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Enterprise-Guide/Turning-off-goptions-in-SAS-EG-code-node/td-p/139509" target="_blank"&gt;https://communities.sas.com/t5/SAS-Enterprise-Guide/Turning-off-goptions-in-SAS-EG-code-node/td-p/139509&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;Markus&lt;/P&gt;</description>
    <pubDate>Sun, 03 Jul 2022 11:02:10 GMT</pubDate>
    <dc:creator>MarkusWeick</dc:creator>
    <dc:date>2022-07-03T11:02:10Z</dc:date>
    <item>
      <title>getting error while running code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821405#M34908</link>
      <description>&lt;P&gt;GOPTIONS ACCESSIBLE;&lt;BR /&gt;23 data reinsurer_share ;&lt;BR /&gt;24 set age_SI ;&lt;BR /&gt;25 quota = 0.05 * SUMINSU ;/* Fixed 5% */&lt;BR /&gt;26 balance = SUMINSU - quota ;&lt;BR /&gt;27 &lt;BR /&gt;28 if START_DATE &amp;lt;= 20180331 then Retention = &amp;amp;GCPP_Retention; /* Check retention of Religare and change accordingly */&lt;BR /&gt;SYMBOLGEN: Macro variable GCPP_RETENTION resolves to 1000000&lt;BR /&gt;29 else Retention = &amp;amp;GCPP_Retention_rev;&lt;BR /&gt;SYMBOLGEN: Macro variable GCPP_RETENTION_REV resolves to 5000000 GOPTIONS NOACCESSIBLE&lt;BR /&gt;NOTE: Line generated by the macro variable "GCPP_RETENTION_REV".&lt;BR /&gt;29 5000000 GOPTIONS NOACCESSIBLE&lt;BR /&gt;________&lt;BR /&gt;388&lt;BR /&gt;76&lt;BR /&gt;ERROR 388-185: Expecting an arithmetic operator.&lt;/P&gt;
&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;
&lt;P&gt;30 &lt;BR /&gt;31 if START_DATE &amp;lt;= 20180331 then Max_Limit = &amp;amp;GCPP_RI_LIMIT; /*Check Max limit of Sum Insured and change accordingly */&lt;BR /&gt;SYMBOLGEN: Macro variable GCPP_RI_LIMIT resolves to 29000000&lt;BR /&gt;32 else Max_Limit = &amp;amp;GCPP_RI_LIMIT_rev;&lt;BR /&gt;SYMBOLGEN: Macro variable GCPP_RI_LIMIT_REV resolves to 50000000&lt;BR /&gt;33 &lt;BR /&gt;34 if SUMINSU &amp;gt; MAX_LIMIT then LIMIT = 'limit exceeds';&lt;BR /&gt;35 &lt;BR /&gt;36 If balance &amp;lt; Retention then RI_Share = 0; /* reinsurer share */&lt;BR /&gt;37 else RI_Share = balance - Retention ;&lt;BR /&gt;38 tenure_yr = round(tenure/365) ;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2022 08:56:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821405#M34908</guid>
      <dc:creator>aanan1417</dc:creator>
      <dc:date>2022-07-03T08:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: getting error while running code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821406#M34909</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/378510"&gt;@aanan1417&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;colud you please show the line, where you define the macro variable GCPP_RETENTION_REV.&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;Markus&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2022 09:45:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821406#M34909</guid>
      <dc:creator>MarkusWeick</dc:creator>
      <dc:date>2022-07-03T09:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: getting error while running code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821407#M34910</link>
      <description>&lt;P&gt;options symbolgen mprint;&lt;BR /&gt;%LET yr =2022 ;/* Current Calender year for which code needs to be run */&lt;BR /&gt;%LET mon =06 ;/* Current Calender month for which code needs to be run */&lt;BR /&gt;%LET posting_month =03 ;/*financial month for which report is generated.Ex - April -01*/&lt;BR /&gt;%Let posting_year = 2022 ;/*financial year of the month for which report is generated.&lt;BR /&gt;ex: 2016-2017 is written as 2016*/&lt;BR /&gt;%Let Treaty_begin_date = 20170515 ;/* First Treaty Begin date */&lt;BR /&gt;%Let Treaty_end_date = 20230331;/* Last treaty end date. Needs to be checked from RI Team every March */&lt;BR /&gt;%LET GCPP_RI_LIMIT = 29000000 ;/*(Before 31/03/2018)Check Maximum Reinsurance Limit with every new treaty*/&lt;BR /&gt;%LET GCPP_RI_LIMIT_rev = 50000000 ;/*(01/04/2018 onwards)Check Maximum Reinsurance Limit with every new treaty*/&lt;BR /&gt;%LET GCPP_Retention = 1000000 ; /*Before 31/03/2018*/&lt;BR /&gt;%LET GCPP_Retention_rev = 5000000 ; /*01/04/2018 onwards*/&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2022 10:22:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821407#M34910</guid>
      <dc:creator>aanan1417</dc:creator>
      <dc:date>2022-07-03T10:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: getting error while running code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821408#M34911</link>
      <description>&lt;PRE&gt;SYMBOLGEN: Macro variable GCPP_RETENTION_REV resolves to 5000000 GOPTIONS NOACCESSIBLE&lt;/PRE&gt;
&lt;P&gt;Somehow, the macro variable GCPP_RETENTION_REV has a value that includes the text GOPTIONS NOACCESSIBLE. That's the problem. How that happened, I don't really know. Can you show us a much larger part of the code, &lt;FONT color="#FF0000"&gt;with nothing removed&lt;/FONT&gt;, so we can see where GCPP_RETENTION_REV is defined all the way down to the place where it is used?&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2022 10:27:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821408#M34911</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-07-03T10:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: getting error while running code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821411#M34912</link>
      <description>&lt;P&gt;%LET yr =2022 ;/* Current Calender year for which code needs to be run */&lt;BR /&gt;%LET mon =06 ;/* Current Calender month for which code needs to be run */&lt;BR /&gt;%LET posting_month =03 ;/*financial month for which report is generated.Ex - April -01*/&lt;BR /&gt;%Let posting_year = 2022 ;/*financial year of the month for which report is generated.&lt;BR /&gt;ex: 2016-2017 is written as 2016*/&lt;BR /&gt;%Let Treaty_begin_date = 20170515 ;/* First Treaty Begin date */&lt;BR /&gt;%Let Treaty_end_date = 20230331;/* Last treaty end date. Needs to be checked from RI Team every March */&lt;BR /&gt;%LET GCPP_RI_LIMIT = 29000000 ;/*(Before 31/03/2018)Check Maximum Reinsurance Limit with every new treaty*/&lt;BR /&gt;%LET GCPP_RI_LIMIT_rev = 50000000 ;/*(01/04/2018 onwards)Check Maximum Reinsurance Limit with every new treaty*/&lt;BR /&gt;%LET GCPP_Retention = 1000000 ; /*Before 31/03/2018*/&lt;BR /&gt;%LET GCPP_Retention_rev = 5000000 ; /*01/04/2018 onwards*/&lt;/P&gt;
&lt;P&gt;/* Sum Insured */&lt;BR /&gt;/* Extracting general data from ACMV */&lt;BR /&gt;proc sql;&lt;BR /&gt;create table SAS0416acmv as&lt;BR /&gt;select A.RLDGACCT as Policy_no informat = $8. length = 8 &lt;BR /&gt;,case&lt;BR /&gt;when A.GLSIGN eq '+' then A.ACCTAMT * -1 else A.ACCTAMT&lt;BR /&gt;end as given_Premium&lt;BR /&gt;,A.POSTYEAR&lt;BR /&gt;,A.POSTMONTH&lt;BR /&gt;,A.EFFDATE&lt;BR /&gt;,A.GLCODE &lt;BR /&gt;,substr(A.RLDGACCT,10,4) as Product_code&lt;BR /&gt;,BATCTRCDE&lt;BR /&gt;,case&lt;BR /&gt;when A.BATCTRCDE = 'T903' then 'New Buisness'&lt;BR /&gt;when A.BATCTRCDE = 'T928' then 'Renewal'&lt;BR /&gt;when A.BATCTRCDE = 'T926' then 'New Buisness Rollback'&lt;BR /&gt;when A.BATCTRCDE = 'T930' then 'Renewal Rollback'&lt;BR /&gt;when A.BATCTRCDE in ('T913','T934') then 'Cancellation'&lt;BR /&gt;when A.BATCTRCDE in ('T922') then 'Endorsements'&lt;BR /&gt;when A.BATCTRCDE in ('TRIT') then 'Reinstatement'&lt;BR /&gt;else 'Others'&lt;BR /&gt;end as Sub_buis_type &lt;BR /&gt;from SAS0416.ACMV_&amp;amp;yr&amp;amp;mon A&lt;BR /&gt;where A.GLCODE contains "RISK" /*Only these rows contain premium received rest all are not required*/&lt;BR /&gt;and A.POSTYEAR = "&amp;amp;posting_year"&lt;BR /&gt;and A.POSTMONTH = "&amp;amp;posting_month"&lt;BR /&gt;order by Policy_no;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;/* Extracting data from ACMV for GCPP*/&lt;BR /&gt;proc sql;&lt;BR /&gt;create table acmv as&lt;BR /&gt;select Policy_no &lt;BR /&gt;,EFFDATE&lt;BR /&gt;,Product_code&lt;BR /&gt;,Sub_buis_type&lt;BR /&gt;,BATCTRCDE&lt;BR /&gt;,given_Premium&lt;BR /&gt;from SAS0416acmv&lt;BR /&gt;where Product_code in('8008',&lt;BR /&gt;'8004',&lt;BR /&gt;'8023',&lt;BR /&gt;'8036',&lt;BR /&gt;'8024',&lt;BR /&gt;'8051',&lt;BR /&gt;'8005',&lt;BR /&gt;'8006',&lt;BR /&gt;'8009',&lt;BR /&gt;'8030',&lt;BR /&gt;'8026',&lt;BR /&gt;'8035',&lt;BR /&gt;'8044',&lt;BR /&gt;'8052',&lt;BR /&gt;'8061',&lt;BR /&gt;'8066',&lt;BR /&gt;'8031',&lt;BR /&gt;'8079',&lt;BR /&gt;'8081',&lt;BR /&gt;'8086',&lt;BR /&gt;'8010',&lt;BR /&gt;'8032',&lt;BR /&gt;'8047',&lt;BR /&gt;'8064',&lt;BR /&gt;'8075',&lt;BR /&gt;'8080',&lt;BR /&gt;'8094',&lt;BR /&gt;'8302',&lt;BR /&gt;'8303',&lt;BR /&gt;'8320',&lt;BR /&gt;'8096',&lt;BR /&gt;'8001',&lt;BR /&gt;'8110',&lt;BR /&gt;'8093',&lt;BR /&gt;'8098',&lt;BR /&gt;'8100',&lt;BR /&gt;'8103',&lt;BR /&gt;'8104',&lt;BR /&gt;'8020',&lt;BR /&gt;'8082',&lt;BR /&gt;'8116',&lt;BR /&gt;'8205',&lt;BR /&gt;'8111',&lt;BR /&gt;'8215',&lt;BR /&gt;'9030',&lt;BR /&gt;'8040',&lt;BR /&gt;'8105',&lt;BR /&gt;'8106',&lt;BR /&gt;'8108',&lt;BR /&gt;'8118',&lt;BR /&gt;'8216',&lt;BR /&gt;'8220',&lt;BR /&gt;'8107',&lt;BR /&gt;'8217'&lt;BR /&gt;)/* Check new codes from IT/RI team every month */&lt;BR /&gt;order by Policy_no;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;/* adding premiums of duplicate policies and removing duplicate Policy_no*/&lt;BR /&gt;proc sql;&lt;BR /&gt;create table acmv1 as&lt;BR /&gt;select Policy_no &lt;BR /&gt;,EFFDATE&lt;BR /&gt;,Product_code&lt;BR /&gt;,Sub_buis_type&lt;BR /&gt;,BATCTRCDE&lt;BR /&gt;,sum(given_Premium) as GWP&lt;BR /&gt;from acmv&lt;BR /&gt;group by Policy_no&lt;BR /&gt;order by Policy_no;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;proc sort data=acmv1 nodupkey out=acmv2 dupout=acmv_duplicates ;&lt;BR /&gt;by Policy_no;&lt;BR /&gt;run ;&lt;/P&gt;
&lt;P&gt;/* PSD,PED, SUBPKGID FROM GCHI */&lt;BR /&gt;proc sql ;&lt;BR /&gt;create table gchi as&lt;BR /&gt;select CHDRNUM as Policy_no&lt;BR /&gt;,CCDATE as Start_date&lt;BR /&gt;,CRDATE as End_date&lt;BR /&gt;,SUBPKGID as Subpackage_id&lt;BR /&gt;,DATIME&lt;BR /&gt;from SAS0416.GCHI_&amp;amp;yr&amp;amp;mon&lt;BR /&gt;ORDER BY Policy_no, Start_date, DATIME DESC;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;proc sort data=gchi nodup dupout=gchi_duplicates;&lt;BR /&gt;by Policy_no;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;/* removing extensions(tenure &amp;lt; 32 days) from gchi */&lt;BR /&gt;data gchi;&lt;BR /&gt;set gchi;&lt;BR /&gt;Start = Start_date;&lt;BR /&gt;En = End_date; &lt;BR /&gt;Start_date1 = min(Start_date,20301231);&lt;BR /&gt;Start_date2 = put(Start_date1,8.);&lt;BR /&gt;Start_date = input(Start_date2,YYMMDD10.);&lt;BR /&gt;DROP Start_date1 Start_date2;&lt;BR /&gt;End_date1 = min(End_date,20301231);&lt;BR /&gt;End_date2 = put(End_date1,8.);&lt;BR /&gt;End_date = input(End_date2,YYMMDD10.);&lt;BR /&gt;DROP End_date1 End_date2 ;&lt;BR /&gt;Tenure = (End_date - Start_date)+1 ;&lt;BR /&gt;IF Tenure &amp;lt; 32 THEN DELETE ;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;DATA GCHI ;&lt;BR /&gt;SET GCHI ;&lt;BR /&gt;RENAME Start = Start_date En = End_date ;&lt;BR /&gt;DROP Start_date End_date ;&lt;BR /&gt;RUN ;&lt;/P&gt;
&lt;P&gt;proc sort data=gchi nodup dupout=gchi_Duplicates ;&lt;BR /&gt;by Policy_no ;&lt;BR /&gt;run ;&lt;/P&gt;
&lt;P&gt;/* merging gchi with acmv on basis of effective date of policy */&lt;BR /&gt;PROC SQL ;&lt;BR /&gt;Create table mergee as&lt;BR /&gt;select A.Policy_no&lt;BR /&gt;,A.Product_code&lt;BR /&gt;,A.EFFDATE&lt;BR /&gt;,B.Start_date&lt;BR /&gt;,B.End_date&lt;BR /&gt;,B.Tenure&lt;BR /&gt;,A.BATCTRCDE&lt;BR /&gt;,A.Sub_buis_type&lt;BR /&gt;,A.GWP&lt;BR /&gt;,B.subpackage_id&lt;BR /&gt;FROM acmv2 A&lt;BR /&gt;LEFT JOIN GCHI B&lt;BR /&gt;ON A.Policy_no = B.Policy_no AND A.EFFDATE BETWEEN B.Start_date AND B.End_date&lt;BR /&gt;ORDER BY A.Policy_no ;&lt;BR /&gt;QUIT ;&lt;/P&gt;
&lt;P&gt;DATA MERGEE ; /* Incorrect policy issued then cancelled.Wrong End date *//*Not Required */&lt;BR /&gt;SET MERGEE ;&lt;BR /&gt;IF POLICY_NO = '10750280' THEN do ;&lt;BR /&gt;Start_date = 20160809 ; End_date = 20160808 ;&lt;BR /&gt;end ;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;/* policy cannot have missing Start date and End date */&lt;BR /&gt;DATA MERGES Merge_miss;&lt;BR /&gt;SET MERGEE ;&lt;BR /&gt;if missing(Start_date) or missing(End_date) then output Merge_miss ;&lt;BR /&gt;ELSE OUTPUT MERGES ;&lt;BR /&gt;RUN ;&lt;/P&gt;
&lt;P&gt;Proc sort data = merges nodup dupout = merges_dupli;&lt;BR /&gt;by Policy_no ;&lt;/P&gt;
&lt;P&gt;/*SI from GXHI */&lt;BR /&gt;proc sql ;&lt;BR /&gt;create table gxhi as&lt;BR /&gt;select CHDRNUM as Policy_no&lt;BR /&gt;,SUMINSU&lt;BR /&gt;,EFFDATE&lt;BR /&gt;,PRODTYP&lt;BR /&gt;from SAS0416.GXHI_&amp;amp;yr&amp;amp;mon&lt;BR /&gt;order by Policy_no, PRODTYP ,EFFDATE desc, DATIME desc ,DTETRM desc;&lt;/P&gt;
&lt;P&gt;proc sort data=gxhi nodup;&lt;BR /&gt;by policy_no ;&lt;BR /&gt;quit ;&lt;/P&gt;
&lt;P&gt;/*Latest SI from gxhi */&lt;BR /&gt;DATA gxhi ;&lt;BR /&gt;set gxhi ;&lt;BR /&gt;by Policy_no PRODTYP;&lt;BR /&gt;IF first.Policy_no and first.PRODTYP then output ;&lt;BR /&gt;run ;&lt;/P&gt;
&lt;P&gt;/* merging SI */&lt;BR /&gt;proc sql ;&lt;BR /&gt;create table merges_gxhi as&lt;BR /&gt;select A.*, B.SUMINSU&lt;BR /&gt;from merges A&lt;BR /&gt;left join gxhi B&lt;BR /&gt;on A.Policy_no = B.Policy_no /*and A.Product_code=B.PRODTYP*/&lt;BR /&gt;order by policy_no ;&lt;/P&gt;
&lt;P&gt;/*removing duplicate policies by adding their premiums*/&lt;BR /&gt;proc sql;&lt;BR /&gt;create table merges_gxhii as&lt;BR /&gt;select Policy_no &lt;BR /&gt;,EFFDATE&lt;BR /&gt;,Product_code&lt;BR /&gt;,Sub_buis_type&lt;BR /&gt;,BATCTRCDE&lt;BR /&gt;,Subpackage_id&lt;BR /&gt;,Start_date&lt;BR /&gt;,End_date&lt;BR /&gt;,SUMINSU&lt;BR /&gt;,Tenure&lt;BR /&gt;,sum(gwp) as Gross_Written_Premium&lt;BR /&gt;from merges_gxhi&lt;BR /&gt;group by Policy_no&lt;BR /&gt;order by Policy_no;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;proc sort data=merges_gxhii nodup dupout=mg ;&lt;BR /&gt;by policy_no ;&lt;BR /&gt;run ;&lt;/P&gt;
&lt;P&gt;/* SI should not be missing */&lt;BR /&gt;DATA merges_gxhii merges_gxhi_miss;&lt;BR /&gt;SET merges_gxhii ;&lt;BR /&gt;if missing(SUMINSU) then output merges_gxhi_miss ;&lt;BR /&gt;ELSE OUTPUT merges_gxhii ;&lt;BR /&gt;RUN ;&lt;/P&gt;
&lt;P&gt;/*policy should lie in treaty period */&lt;BR /&gt;data merges_gxhii ;&lt;BR /&gt;set merges_gxhii ;&lt;BR /&gt;if Start_date &amp;gt;= "&amp;amp;Treaty_begin_date" and Start_date &amp;lt;= "&amp;amp;Treaty_end_date" then output ;&lt;BR /&gt;run ;&lt;/P&gt;
&lt;P&gt;/*Age*/&lt;BR /&gt;/* member level data from GMHD */&lt;BR /&gt;Proc sql ;&lt;BR /&gt;create table gmhd as&lt;BR /&gt;select distinct CHDRNUM as Policy_no&lt;BR /&gt;,CLNTNUM&lt;BR /&gt;,DPNTTYP&lt;BR /&gt;,DTETRM&lt;BR /&gt;from SAS0416.GMHD_&amp;amp;yr&amp;amp;mon&lt;BR /&gt;ORDER BY Policy_no ;&lt;/P&gt;
&lt;P&gt;proc sort data=gmhd;&lt;BR /&gt;by CLNTNUM ;&lt;BR /&gt;quit ;&lt;/P&gt;
&lt;P&gt;Proc sql ;&lt;BR /&gt;create table CLNTPF_&amp;amp;yr&amp;amp;mon as &lt;BR /&gt;select distinct CLNTNUM AS Client_no&lt;BR /&gt;,CLTDOB as Client_dob&lt;BR /&gt;from SAS0416.CLNTPF_&amp;amp;yr&amp;amp;mon&lt;BR /&gt;where VALIDFLAG = '1' /* Current DOB of member is determined from this filter */ &lt;BR /&gt;order by Client_no ;&lt;/P&gt;
&lt;P&gt;Proc sort data = CLNTPF_&amp;amp;yr&amp;amp;mon nodup dupout=dup ;&lt;BR /&gt;by Client_no ;&lt;/P&gt;
&lt;P&gt;/* merging dob with all members */&lt;BR /&gt;Proc sql ;&lt;BR /&gt;create table gmhd_clntpf as&lt;BR /&gt;select A.Policy_no&lt;BR /&gt;,A.CLNTNUM&lt;BR /&gt;,A.DPNTTYP&lt;BR /&gt;,A.DTETRM&lt;BR /&gt;,B.Client_dob&lt;BR /&gt;FROM gmhd A&lt;BR /&gt;LEFT JOIN CLNTPF_&amp;amp;yr&amp;amp;mon B&lt;BR /&gt;ON A.CLNTNUM = B.Client_no;&lt;/P&gt;
&lt;P&gt;Proc sort data= gmhd_clntpf nodup dupout=dupli;&lt;BR /&gt;by Policy_no ;&lt;BR /&gt;run ;&lt;/P&gt;
&lt;P&gt;/*individual and floater tag in policy*/&lt;BR /&gt;proc sql ;&lt;BR /&gt;CREATE TABLE glhd as&lt;BR /&gt;select CHDRNUM as Policy_no&lt;BR /&gt;,LMTWHOM as Policy_Type&lt;BR /&gt;,datime&lt;BR /&gt;,DTETRM&lt;BR /&gt;from SAS0416.GLHD_&amp;amp;yr&amp;amp;mon&lt;BR /&gt;WHERE LMTWHOM IN ('IF','IN') &lt;BR /&gt;ORDER BY Policy_no , datime ,DTETRM;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;DATA glhd ;&lt;BR /&gt;set glhd ;&lt;BR /&gt;by Policy_no ;&lt;BR /&gt;if last.Policy_no then output ;/* latest tag of policy is pulled*/&lt;BR /&gt;run ;&lt;/P&gt;
&lt;P&gt;proc sort data=glhd nodupkey dupout=d ;&lt;BR /&gt;by Policy_no ;&lt;/P&gt;
&lt;P&gt;Proc sql ;&lt;BR /&gt;create table gm_cl_gl as&lt;BR /&gt;select A.Policy_no&lt;BR /&gt;,A.CLNTNUM&lt;BR /&gt;,A.DPNTTYP&lt;BR /&gt;,A.DTETRM&lt;BR /&gt;,A.Client_dob&lt;BR /&gt;,B.Policy_Type&lt;BR /&gt;FROM gmhd_clntpf A&lt;BR /&gt;LEFT JOIN glhd B&lt;BR /&gt;ON A.Policy_no = B.Policy_no &lt;BR /&gt;order by Policy_no;&lt;/P&gt;
&lt;P&gt;/* Determining proposer and its coverage in policy */&lt;BR /&gt;PROC SQL ;&lt;BR /&gt;CREATE TABLE GCHD AS &lt;BR /&gt;SELECT distinct CHDRNUM as Policy_no&lt;BR /&gt;,COWNNUM as Proposer_no&lt;BR /&gt;,ZOWNERCV as Owner_covered&lt;BR /&gt;FROM SAS0416.GCHD_&amp;amp;yr&amp;amp;mon &lt;BR /&gt;order by Policy_no ;&lt;/P&gt;
&lt;P&gt;proc sql ;&lt;BR /&gt;create table gm_cl_gl_gc as&lt;BR /&gt;select A.Policy_no&lt;BR /&gt;,A.CLNTNUM&lt;BR /&gt;,A.DPNTTYP&lt;BR /&gt;,A.DTETRM&lt;BR /&gt;,A.Client_dob&lt;BR /&gt;,A.Policy_Type&lt;BR /&gt;,B.Proposer_no&lt;BR /&gt;,B.Owner_covered&lt;BR /&gt;FROM gm_cl_gl A&lt;BR /&gt;LEFT JOIN GCHD B&lt;BR /&gt;ON A.Policy_no = B.Policy_no ;&lt;BR /&gt;quit ;&lt;/P&gt;
&lt;P&gt;/* Deletion of proposer if not covered in policy*/&lt;BR /&gt;data gm_cl_gl_gc1 ;&lt;BR /&gt;set gm_cl_gl_gc ;&lt;BR /&gt;if CLNTNUM = Proposer_no and Owner_covered = 'N' then delete ;&lt;BR /&gt;run ;&lt;/P&gt;
&lt;P&gt;PROC SORT DATA=gm_cl_gl_gc1 NODUP DUPOUT=X;&lt;BR /&gt;BY Policy_no ;&lt;BR /&gt;quit ;&lt;/P&gt;
&lt;P&gt;/*Merging member level info with the Req policies */&lt;BR /&gt;Proc sql ;&lt;BR /&gt;create table Age_base as &lt;BR /&gt;select B.Policy_no&lt;BR /&gt;,A.CLNTNUM&lt;BR /&gt;,A.DPNTTYP&lt;BR /&gt;,A.DTETRM&lt;BR /&gt;,A.Client_dob&lt;BR /&gt;,A.Policy_Type&lt;BR /&gt;,A.Proposer_no&lt;BR /&gt;,B.Start_date&lt;BR /&gt;,B.BATCTRCDE&lt;BR /&gt;,B.Gross_Written_Premium&lt;BR /&gt;FROM merges_gxhii B&lt;BR /&gt;LEFT JOIN gm_cl_gl_gc1 A&lt;BR /&gt;ON A.Policy_no = B.Policy_no &lt;BR /&gt;order by B.policy_no ,A.CLNTNUM ,A.DTETRM desc ;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;/* Deletion of Termed Members */&lt;BR /&gt;Data Age_base1 ;&lt;BR /&gt;set Age_base ;&lt;BR /&gt;Start = Start_date ;&lt;BR /&gt;Term = DTETRM ;&lt;BR /&gt;Start_date1 = min(Start_date,20301231);&lt;BR /&gt;Start_date2 = put(Start_date1,8.);&lt;BR /&gt;Start_date = input(Start_date2,YYMMDD10.);&lt;BR /&gt;DTETRM1 = min(DTETRM,20301231);&lt;BR /&gt;DTETRM2 = put(DTETRM1,8.);&lt;BR /&gt;DTETRM = input(DTETRM2,YYMMDD10.);&lt;BR /&gt;if DTETRM &amp;lt; Start_date then delete ;&lt;BR /&gt;drop Start_date1 Start_date2 start_date DTETRM1 DTETRM2 DTETRM ;&lt;BR /&gt;rename Start = Start_date Term = DTETRM ;&lt;BR /&gt;run ;&lt;/P&gt;
&lt;P&gt;Proc sort data = Age_base1 nodupkey dupout=dup ;&lt;BR /&gt;by Policy_no /*descending clntnum*/ ;&lt;BR /&gt;quit ;&lt;/P&gt;
&lt;P&gt;/* Determining age as on last birthday */ &lt;BR /&gt;data Age ;&lt;BR /&gt;SET Age_base1 ;&lt;BR /&gt;Client_birth_dt = Client_dob ;&lt;BR /&gt;Policy_start_dt = Start_date ; &lt;BR /&gt;Client_dob1=min(Client_dob,20301231);&lt;BR /&gt;Client_dob2=put(Client_dob1,8.);&lt;BR /&gt;Client_dob=input(Client_dob2,yymmdd10.);&lt;BR /&gt;DROP Client_dob1 Client_dob2;&lt;BR /&gt;Start_date1=min(Start_date,20301231);&lt;BR /&gt;Start_date2=put(Start_date1,8.);&lt;BR /&gt;Start_date=input(Start_date2,yymmdd10.);&lt;BR /&gt;DROP Start_date1 Start_date2;&lt;BR /&gt;Age = floor((Start_date - Client_dob)/365.25);&lt;BR /&gt;drop Client_dob Start_date;&lt;BR /&gt;run ;&lt;/P&gt;
&lt;P&gt;Proc sort data=Age nodup out=correct dupout=kk;&lt;BR /&gt;by policy_no descending Age ;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;/* For floater policy Member with max age is taken and &lt;BR /&gt;For individual all the members will be considered in RI Premium calculation */&lt;BR /&gt;data max_age ;&lt;BR /&gt;set correct ;&lt;BR /&gt;by policy_no ;&lt;BR /&gt;if Policy_Type in ('IF' ) then do ;&lt;BR /&gt;if first.policy_no then output ;&lt;BR /&gt;end ;&lt;BR /&gt;IF Policy_Type in ('IN') THEN OUTPUT ;&lt;BR /&gt;drop DTETRM ;&lt;BR /&gt;run ;&lt;/P&gt;
&lt;P&gt;Proc sort data=max_age ;&lt;BR /&gt;by policy_no ;&lt;/P&gt;
&lt;P&gt;Proc sort data=merges_gxhii ;&lt;BR /&gt;by policy_no ;&lt;BR /&gt;run ;&lt;/P&gt;
&lt;P&gt;/*Merging age and SI */&lt;BR /&gt;data age_SI AGE SI nowhere;&lt;BR /&gt;merge merges_gxhii (in=a)&lt;BR /&gt;max_age (in=b);&lt;BR /&gt;by Policy_no ;&lt;BR /&gt;if A=1 and B=1 then output age_SI ;&lt;BR /&gt;else if A=0 and B=0 then output nowhere ;&lt;BR /&gt;else if A=1 and B=0 then output SI ; &lt;BR /&gt;else if A=0 and B=1 then output AGE ;&lt;BR /&gt;run ;&lt;/P&gt;
&lt;P&gt;data reinsurer_share ;&lt;BR /&gt;set age_SI ;&lt;BR /&gt;quota = 0.05 * SUMINSU ;/* Fixed 5% */&lt;BR /&gt;balance = SUMINSU - quota ;&lt;/P&gt;
&lt;P&gt;if START_DATE &amp;lt;= 20180331 then Retention = &amp;amp;GCPP_Retention; /* Check retention of Religare and change accordingly */&lt;BR /&gt;else Retention = &amp;amp;GCPP_Retention_rev;&lt;/P&gt;
&lt;P&gt;if START_DATE &amp;lt;= 20180331 then Max_Limit = &amp;amp;GCPP_RI_LIMIT; /*Check Max limit of Sum Insured and change accordingly */&lt;BR /&gt;else Max_Limit = &amp;amp;GCPP_RI_LIMIT_rev;&lt;/P&gt;
&lt;P&gt;if SUMINSU &amp;gt; MAX_LIMIT then LIMIT = 'limit exceeds';&lt;/P&gt;
&lt;P&gt;If balance &amp;lt; Retention then RI_Share = 0; /* reinsurer share */&lt;BR /&gt;else RI_Share = balance - Retention ;&lt;BR /&gt;tenure_yr = round(tenure/365) ;&lt;BR /&gt;run ;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2022 10:30:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821411#M34912</guid>
      <dc:creator>aanan1417</dc:creator>
      <dc:date>2022-07-03T10:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: getting error while running code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821412#M34913</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/378510"&gt;@aanan1417&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;maybe this is woth a try:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Enterprise-Guide/Turning-off-goptions-in-SAS-EG-code-node/td-p/139509" target="_blank"&gt;https://communities.sas.com/t5/SAS-Enterprise-Guide/Turning-off-goptions-in-SAS-EG-code-node/td-p/139509&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;Markus&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2022 11:02:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821412#M34913</guid>
      <dc:creator>MarkusWeick</dc:creator>
      <dc:date>2022-07-03T11:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: getting error while running code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821413#M34914</link>
      <description>Several of your %LET statements are missing a semicolon.  Actually it is difficult to envision how the program got that far without them.  Anyway  fix the known problem and see what remains.</description>
      <pubDate>Sun, 03 Jul 2022 12:03:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821413#M34914</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2022-07-03T12:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: getting error while running code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821414#M34915</link>
      <description>&lt;P&gt;Immediately before running this code, you ran the %LET statement which defines&amp;nbsp;&lt;SPAN&gt;GCPP_Retention_rev without its closing semicolon, so the auto-generated initialization statement&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;GOPTIONS NOACCESSIBLE;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;became part of the macro variable.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;When running partial code, always make sure you also include the semicolon.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2022 12:03:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821414#M34915</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-07-03T12:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: getting error while running code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821416#M34916</link>
      <description>Tricky one. Cool!</description>
      <pubDate>Sun, 03 Jul 2022 13:09:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821416#M34916</guid>
      <dc:creator>MarkusWeick</dc:creator>
      <dc:date>2022-07-03T13:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: getting error while running code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821424#M34917</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/378510"&gt;@aanan1417&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I am curious. Does the error disappear, when you run the code as a whole?&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;Markus&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2022 17:49:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821424#M34917</guid>
      <dc:creator>MarkusWeick</dc:creator>
      <dc:date>2022-07-03T17:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: getting error while running code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821983#M34959</link>
      <description>&lt;P&gt;Thanks a ton&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 05:53:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/getting-error-while-running-code/m-p/821983#M34959</guid>
      <dc:creator>aanan1417</dc:creator>
      <dc:date>2022-07-07T05:53:34Z</dc:date>
    </item>
  </channel>
</rss>

