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 ** or 10**6
Your log should show something like:
547 data temp;
548 do lambda = 1/(12*10^6);
-
22
76
ERROR 22-322: Syntax error, expecting one of the following: <, <=, =, >, >=, 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;
Fixing the exponent is not sufficient:
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.
You do not want the DO in front of the Lambda:
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.
Since your data set did not complete successfully the Proc SGPLOT might be using an older data set named Temp.
The set you make would not have a variable CLOSE so the HISTOGRAM statement is in error.
569 Proc sgplot data=temp;
570 histogram close;
ERROR: Variable CLOSE not found.
571 run;
I would expect to see: Histogram X;
READ your log. Click on the Log tab. See the errors.
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 </> icon above the message window on the forum and paste the copied text.
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.
... View more