<?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 Risk Dimensions ERROR: Parsing error generating code in SAS Risk Management</title>
    <link>https://communities.sas.com/t5/SAS-Risk-Management/Risk-Dimensions-ERROR-Parsing-error-generating-code/m-p/697754#M384</link>
    <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When submitting the following code to create a subroutine to be used in a pricing function within Risk Dimension, I receive the error stated in the subject.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;proc compile outlib = Rd_env.SampleRDEnv &amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;env = Rd_env.SampleRDEnv&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp;package = FUNCPACK;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; /*&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; Function PV_DUR_CSHFLW is used to calculates the Present Value and the Macauley Duration&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; */&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; subroutine PV_DUR_CSHFLW (N ,VDate, Date[*], Amount[*], ZCCurve[*],ZCCMAT[*], Present_Value, MacDuration)&lt;/DIV&gt;
&lt;DIV&gt;label = "Present Value function"&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; kind &amp;nbsp;= "Pricing Functions";&lt;/DIV&gt;
&lt;DIV&gt;outargs Present_Value, MacDuration;&lt;/DIV&gt;
&lt;DIV&gt;Present_Value = 0;&lt;/DIV&gt;
&lt;DIV&gt;MacDuration &amp;nbsp; = 0; &amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;do i = 1 to N;&lt;/DIV&gt;
&lt;DIV&gt;p = Date[i] - VDate;&lt;/DIV&gt;
&lt;DIV&gt;p_year = p/365.25;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;if p gt 0 then do;&lt;/DIV&gt;
&lt;DIV&gt;r &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = RATE_RF2(p_year, ZCCURVE, ZCCMAT);&lt;/DIV&gt;
&lt;DIV&gt;d &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = exp( -p_year*log(1 + r/100));&lt;/DIV&gt;
&lt;DIV&gt;MacDuration &amp;nbsp; = MacDuration + (p_year * d *(Amount[i]));&lt;/DIV&gt;
&lt;DIV&gt;Present_Value = Present_Value + d*(Amount[i]); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;end;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;end;&lt;/DIV&gt;
&lt;DIV&gt;if Present_Value gt 0 then do;&lt;/DIV&gt;
&lt;DIV&gt;MacDuration = MacDuration/Present_Value;&lt;/DIV&gt;
&lt;DIV&gt;end;&lt;/DIV&gt;
&lt;DIV&gt;else do; MacDuration = 0; end;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; endsub;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Does anyone know how to solve that?&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Thanks in advance for your help!&lt;/DIV&gt;</description>
    <pubDate>Tue, 10 Nov 2020 13:44:23 GMT</pubDate>
    <dc:creator>PiergiorgioC</dc:creator>
    <dc:date>2020-11-10T13:44:23Z</dc:date>
    <item>
      <title>Risk Dimensions ERROR: Parsing error generating code</title>
      <link>https://communities.sas.com/t5/SAS-Risk-Management/Risk-Dimensions-ERROR-Parsing-error-generating-code/m-p/697754#M384</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When submitting the following code to create a subroutine to be used in a pricing function within Risk Dimension, I receive the error stated in the subject.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;proc compile outlib = Rd_env.SampleRDEnv &amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;env = Rd_env.SampleRDEnv&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp;package = FUNCPACK;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; /*&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; Function PV_DUR_CSHFLW is used to calculates the Present Value and the Macauley Duration&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; */&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; subroutine PV_DUR_CSHFLW (N ,VDate, Date[*], Amount[*], ZCCurve[*],ZCCMAT[*], Present_Value, MacDuration)&lt;/DIV&gt;
&lt;DIV&gt;label = "Present Value function"&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; kind &amp;nbsp;= "Pricing Functions";&lt;/DIV&gt;
&lt;DIV&gt;outargs Present_Value, MacDuration;&lt;/DIV&gt;
&lt;DIV&gt;Present_Value = 0;&lt;/DIV&gt;
&lt;DIV&gt;MacDuration &amp;nbsp; = 0; &amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;do i = 1 to N;&lt;/DIV&gt;
&lt;DIV&gt;p = Date[i] - VDate;&lt;/DIV&gt;
&lt;DIV&gt;p_year = p/365.25;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;if p gt 0 then do;&lt;/DIV&gt;
&lt;DIV&gt;r &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = RATE_RF2(p_year, ZCCURVE, ZCCMAT);&lt;/DIV&gt;
&lt;DIV&gt;d &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = exp( -p_year*log(1 + r/100));&lt;/DIV&gt;
&lt;DIV&gt;MacDuration &amp;nbsp; = MacDuration + (p_year * d *(Amount[i]));&lt;/DIV&gt;
&lt;DIV&gt;Present_Value = Present_Value + d*(Amount[i]); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;end;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;end;&lt;/DIV&gt;
&lt;DIV&gt;if Present_Value gt 0 then do;&lt;/DIV&gt;
&lt;DIV&gt;MacDuration = MacDuration/Present_Value;&lt;/DIV&gt;
&lt;DIV&gt;end;&lt;/DIV&gt;
&lt;DIV&gt;else do; MacDuration = 0; end;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; endsub;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Does anyone know how to solve that?&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Thanks in advance for your help!&lt;/DIV&gt;</description>
      <pubDate>Tue, 10 Nov 2020 13:44:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Risk-Management/Risk-Dimensions-ERROR-Parsing-error-generating-code/m-p/697754#M384</guid>
      <dc:creator>PiergiorgioC</dc:creator>
      <dc:date>2020-11-10T13:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Parsing error generating code</title>
      <link>https://communities.sas.com/t5/SAS-Risk-Management/Risk-Dimensions-ERROR-Parsing-error-generating-code/m-p/697801#M385</link>
      <description>&lt;P&gt;What is PROC COMPILE? Never heard of that.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 05:43:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Risk-Management/Risk-Dimensions-ERROR-Parsing-error-generating-code/m-p/697801#M385</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-11-10T05:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Parsing error generating code</title>
      <link>https://communities.sas.com/t5/SAS-Risk-Management/Risk-Dimensions-ERROR-Parsing-error-generating-code/m-p/697802#M386</link>
      <description>&lt;P&gt;I guess you want to use&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=proc&amp;amp;docsetTarget=p10b4qouzgi6sqn154ipglazix2q.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;PROC FCMP&lt;/A&gt;. I could not find a single reference to a COMPILE procedure.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 07:11:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Risk-Management/Risk-Dimensions-ERROR-Parsing-error-generating-code/m-p/697802#M386</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-10T07:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Parsing error generating code</title>
      <link>https://communities.sas.com/t5/SAS-Risk-Management/Risk-Dimensions-ERROR-Parsing-error-generating-code/m-p/697806#M387</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/246395"&gt;@PiergiorgioC&lt;/a&gt; - The documentation for this product is password-secured so only RD customers will be able to help. I suggest you track this SAS Tech Support.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 06:17:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Risk-Management/Risk-Dimensions-ERROR-Parsing-error-generating-code/m-p/697806#M387</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-10T06:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Parsing error generating code</title>
      <link>https://communities.sas.com/t5/SAS-Risk-Management/Risk-Dimensions-ERROR-Parsing-error-generating-code/m-p/697820#M388</link>
      <description>It's a procedure specific for Risk Dimension used to create and register functions, subroutines and pricing methods in a risk environment</description>
      <pubDate>Tue, 10 Nov 2020 08:14:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Risk-Management/Risk-Dimensions-ERROR-Parsing-error-generating-code/m-p/697820#M388</guid>
      <dc:creator>PiergiorgioC</dc:creator>
      <dc:date>2020-11-10T08:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Parsing error generating code</title>
      <link>https://communities.sas.com/t5/SAS-Risk-Management/Risk-Dimensions-ERROR-Parsing-error-generating-code/m-p/697827#M389</link>
      <description>&lt;P&gt;Did you get that ERROR in the log? If yes, post the complete log of that procedure step into a window opened with the &amp;lt;/&amp;gt; button. We &lt;EM&gt;might&lt;/EM&gt; be able to provide some pointers from that.&lt;/P&gt;
&lt;P&gt;Since you are a user of RD, you should get access to the documentation mentioned above; since we don't have that access, we can't apply our doc-fu to help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/14323"&gt;@ShelleySessoms&lt;/a&gt;&amp;nbsp;could you check for us why there is a password wall for that particular documentation?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 09:26:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Risk-Management/Risk-Dimensions-ERROR-Parsing-error-generating-code/m-p/697827#M389</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-10T09:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Parsing error generating code</title>
      <link>https://communities.sas.com/t5/SAS-Risk-Management/Risk-Dimensions-ERROR-Parsing-error-generating-code/m-p/697878#M390</link>
      <description>&lt;P&gt;There are a few pieces of documentation that are password protected, to be accessed by only licensed customers due to proprietary information: "&lt;SPAN&gt;The&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;documentation&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;for&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;SAS Risk Dimensions&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;is provided on a secure site that requires an access key. Licensed customers can request the access key from&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;SAS&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;Technical Support. In order to expedite your request, please include&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;SAS Risk Dimensions&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;in the subject field of the form."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;is correct in that contacting Tech Support is the best option here. They can not only help answer the question, but they can provide the access key to the documentation.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 12:41:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Risk-Management/Risk-Dimensions-ERROR-Parsing-error-generating-code/m-p/697878#M390</guid>
      <dc:creator>ShelleySessoms</dc:creator>
      <dc:date>2020-11-10T12:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Risk Dimensions ERROR: Parsing error generating code</title>
      <link>https://communities.sas.com/t5/SAS-Risk-Management/Risk-Dimensions-ERROR-Parsing-error-generating-code/m-p/760965#M419</link>
      <description>&lt;P&gt;Working without any problem (RD 6.12).&lt;/P&gt;&lt;P&gt;Just the call of the RATE_RF2 I need to skip as this is not know in my project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let ENV_NM= myEnv;&lt;BR /&gt;%let OUTLIB_NM = work;&lt;BR /&gt;proc risk noseqcheck ;&lt;/P&gt;&lt;P&gt;environment new = work.&amp;amp;ENV_NM ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc compile outlib = &amp;amp;OUTLIB_NM.&lt;BR /&gt;env = &amp;amp;ENV_NM.&lt;BR /&gt;package = FUNCPACK;&lt;BR /&gt;&lt;BR /&gt;/*&lt;BR /&gt;Function PV_DUR_CSHFLW is used to calculates the Present Value and the Macauley Duration&lt;BR /&gt;*/&lt;BR /&gt;&lt;BR /&gt;subroutine PV_DUR_CSHFLW (N ,VDate, Date[*], Amount[*], ZCCurve[*],ZCCMAT[*], Present_Value, MacDuration)&lt;BR /&gt;label = "Present Value function"&lt;BR /&gt;kind = "Pricing Functions";&lt;BR /&gt;outargs Present_Value, MacDuration;&lt;BR /&gt;Present_Value = 0;&lt;BR /&gt;MacDuration = 0;&lt;BR /&gt;do i = 1 to N;&lt;BR /&gt;p = Date[i] - VDate;&lt;BR /&gt;p_year = p/365.25;&lt;BR /&gt;if p gt 0 then do;&lt;BR /&gt;/*r = RATE_RF2(p_year, ZCCURVE, ZCCMAT); not know in my Project XXX */&lt;BR /&gt;r = 1;&lt;BR /&gt;d = exp( -p_year*log(1 + r/100));&lt;BR /&gt;MacDuration = MacDuration + (p_year * d *(Amount[i]));&lt;BR /&gt;Present_Value = Present_Value + d*(Amount[i]);&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;if Present_Value gt 0 then do;&lt;BR /&gt;MacDuration = MacDuration/Present_Value;&lt;BR /&gt;end;&lt;BR /&gt;else do;&lt;BR /&gt;MacDuration = 0;&lt;BR /&gt;end;&lt;BR /&gt;endsub;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Log:&lt;/P&gt;&lt;PRE&gt;26         %let ENV_NM= myEnv;
27         %let OUTLIB_NM = work;
28         proc risk noseqcheck ;
29         
30               environment new = work.&amp;amp;ENV_NM ;
31         
32         run;

NOTE: Statement parsing used 0 seconds of CPU time.
NOTE: The SAS Risk Dimensions engine is running at version 6.12.
NOTE: The current environment is "myEnv" in the directory 
      "/saswork/SAS_work067500016C18_sasgxxx/SAS_work214D00016C18_xxx.eb.lan.at/".
NOTE: PROCEDURE RISK used (Total process time):
      real time           0.02 seconds
      cpu time            0.03 seconds
      

33         
34         proc compile outlib = &amp;amp;OUTLIB_NM.
35         			 env = &amp;amp;ENV_NM.
36            			 package = FUNCPACK;
NOTE: The SAS Risk Dimensions engine is running at version 6.12.
37         
38           /*
39           Function PV_DUR_CSHFLW is used to calculates the Present Value and the Macauley Duration
40           */
41         
42           subroutine PV_DUR_CSHFLW (N ,VDate, Date[*], Amount[*], ZCCurve[*],ZCCMAT[*], Present_Value, MacDuration)
43         label = "Present Value function"
44             kind  = "Pricing Functions";
45         outargs Present_Value, MacDuration;
46         Present_Value = 0;
47         MacDuration   = 0;
48         do i = 1 to N;
49         p = Date[i] - VDate;
50         p_year = p/365.25;
51         if p gt 0 then do;
52         /*r             = RATE_RF2(p_year, ZCCURVE, ZCCMAT);*/
53         r = 1;
54         d             = exp( -p_year*log(1 + r/100));
55         MacDuration   = MacDuration + (p_year * d *(Amount[i]));
56         Present_Value = Present_Value + d*(Amount[i]);
57         end;
58         end;
59         if Present_Value gt 0 then do;
60         MacDuration = MacDuration/Present_Value;
61         end;
62         else do; MacDuration = 0; end;
63         
64           endsub;
65         run;

NOTE: Function PV_DUR_CSHFLW saved to WORK.work.FUNCPACK.
NOTE: PROCEDURE COMPILE used (Total process time):
      real time           0.02 seconds
      cpu time            0.03 seconds&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Aug 2021 16:43:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Risk-Management/Risk-Dimensions-ERROR-Parsing-error-generating-code/m-p/760965#M419</guid>
      <dc:creator>ArnoldP</dc:creator>
      <dc:date>2021-08-11T16:43:18Z</dc:date>
    </item>
  </channel>
</rss>

