<?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: i try to obtain a histogram for a random data, and i think my coding is worry in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/i-try-to-obtain-a-histogram-for-a-random-data-and-i-think-my/m-p/793040#M32727</link>
    <description>&lt;P&gt;Your data step as shown should show several errors. First, exponentiation in SAS is not done with an ^. To make 10 to the 6th power use **&amp;nbsp; or 10**6&lt;/P&gt;
&lt;P&gt;Your log should show something like:&lt;/P&gt;
&lt;PRE&gt;547  data temp;
548     do lambda = 1/(12*10^6);
                             -
                             22
                             76
ERROR 22-322: Syntax error, expecting one of the following: &amp;lt;, &amp;lt;=, =, &amp;gt;, &amp;gt;=, EQ, GE, GT, LE, LT,
              NE, NG, NL, ^=, ~=.

ERROR 76-322: Syntax error, statement will be ignored.

549        do i=1 to 1000;
550           x=ranexp(1999)/lambda;
551           output;
552        end;
553  run;
&lt;/PRE&gt;
&lt;P&gt;Fixing the exponent is not sufficient:&lt;/P&gt;
&lt;PRE&gt;554  data temp;
555     do lambda = 1/(12*10**6);
556        do i=1 to 1000;
557           x=ranexp(1999)/lambda;
558           output;
559        end;
560  run;

560  run;
        -
        117
ERROR 117-185: There was 1 unclosed DO block.

&lt;/PRE&gt;
&lt;P&gt;You do not want the DO in front of the Lambda:&lt;/P&gt;
&lt;PRE&gt;561  data temp;
562        lambda = 1/(12*10**6);
563        do i=1 to 1000;
564           x=ranexp(1999)/lambda;
565           output;
566        end;
567  run;

NOTE: The data set WORK.TEMP has 1000 observations and 3 variables.

&lt;/PRE&gt;
&lt;P&gt;Since your data set did not complete successfully the Proc SGPLOT might be using an older data set named Temp.&lt;/P&gt;
&lt;P&gt;The set you make would not have a variable CLOSE so the HISTOGRAM statement is in error.&lt;/P&gt;
&lt;PRE&gt;569  Proc sgplot data=temp;
570     histogram close;
ERROR: Variable CLOSE not found.
571  run;
&lt;/PRE&gt;
&lt;P&gt;I would expect to see: Histogram X;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;READ your log. &lt;/STRONG&gt;Click on the Log tab. See the errors.&lt;/P&gt;
&lt;P&gt;You should be able to copy text from the log and paste that into the forum to ask questions about things that do not work. Open a text box, such as my log entries above, with the &amp;lt;/&amp;gt; icon above the message window on the forum and paste the copied text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do not see any attempt to get an "integer portion". I would expect to see one of the functions such as ROUND, FLOOR, CEIL to reduce X to an integer.&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jan 2022 00:20:57 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-01-28T00:20:57Z</dc:date>
    <item>
      <title>i try to obtain a histogram for a random data, and i think my coding is worry</title>
      <link>https://communities.sas.com/t5/New-SAS-User/i-try-to-obtain-a-histogram-for-a-random-data-and-i-think-my/m-p/793036#M32726</link>
      <description>&lt;P&gt;hello, so i try to create the random dataset, i have an exponential distribution with parameter lambda is 1/(12*10^6) and the seed 1999 and i try to generate the 1000 revenues and retain the integer portion for establishments. here is the code below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-01-27 at 6.59.11 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67943i3E7C35839F10D19A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-01-27 at 6.59.11 PM.png" alt="Screen Shot 2022-01-27 at 6.59.11 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 00:04:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/i-try-to-obtain-a-histogram-for-a-random-data-and-i-think-my/m-p/793036#M32726</guid>
      <dc:creator>tmorr</dc:creator>
      <dc:date>2022-01-28T00:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: i try to obtain a histogram for a random data, and i think my coding is worry</title>
      <link>https://communities.sas.com/t5/New-SAS-User/i-try-to-obtain-a-histogram-for-a-random-data-and-i-think-my/m-p/793040#M32727</link>
      <description>&lt;P&gt;Your data step as shown should show several errors. First, exponentiation in SAS is not done with an ^. To make 10 to the 6th power use **&amp;nbsp; or 10**6&lt;/P&gt;
&lt;P&gt;Your log should show something like:&lt;/P&gt;
&lt;PRE&gt;547  data temp;
548     do lambda = 1/(12*10^6);
                             -
                             22
                             76
ERROR 22-322: Syntax error, expecting one of the following: &amp;lt;, &amp;lt;=, =, &amp;gt;, &amp;gt;=, EQ, GE, GT, LE, LT,
              NE, NG, NL, ^=, ~=.

ERROR 76-322: Syntax error, statement will be ignored.

549        do i=1 to 1000;
550           x=ranexp(1999)/lambda;
551           output;
552        end;
553  run;
&lt;/PRE&gt;
&lt;P&gt;Fixing the exponent is not sufficient:&lt;/P&gt;
&lt;PRE&gt;554  data temp;
555     do lambda = 1/(12*10**6);
556        do i=1 to 1000;
557           x=ranexp(1999)/lambda;
558           output;
559        end;
560  run;

560  run;
        -
        117
ERROR 117-185: There was 1 unclosed DO block.

&lt;/PRE&gt;
&lt;P&gt;You do not want the DO in front of the Lambda:&lt;/P&gt;
&lt;PRE&gt;561  data temp;
562        lambda = 1/(12*10**6);
563        do i=1 to 1000;
564           x=ranexp(1999)/lambda;
565           output;
566        end;
567  run;

NOTE: The data set WORK.TEMP has 1000 observations and 3 variables.

&lt;/PRE&gt;
&lt;P&gt;Since your data set did not complete successfully the Proc SGPLOT might be using an older data set named Temp.&lt;/P&gt;
&lt;P&gt;The set you make would not have a variable CLOSE so the HISTOGRAM statement is in error.&lt;/P&gt;
&lt;PRE&gt;569  Proc sgplot data=temp;
570     histogram close;
ERROR: Variable CLOSE not found.
571  run;
&lt;/PRE&gt;
&lt;P&gt;I would expect to see: Histogram X;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;READ your log. &lt;/STRONG&gt;Click on the Log tab. See the errors.&lt;/P&gt;
&lt;P&gt;You should be able to copy text from the log and paste that into the forum to ask questions about things that do not work. Open a text box, such as my log entries above, with the &amp;lt;/&amp;gt; icon above the message window on the forum and paste the copied text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do not see any attempt to get an "integer portion". I would expect to see one of the functions such as ROUND, FLOOR, CEIL to reduce X to an integer.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 00:20:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/i-try-to-obtain-a-histogram-for-a-random-data-and-i-think-my/m-p/793040#M32727</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-01-28T00:20:57Z</dc:date>
    </item>
  </channel>
</rss>

