Hi, I am writing a SAS application in SCL that takes random samples of a uniform distriubtion (using macros) to show that as the sample size increases, the sampling distribution of the mean takes on a more normal shape (I plan on doing it for multiple distributions, once I figure out the Uniform first). My program works like this at the moment: the user selects a distribution and then the %macro uniform and %macro usd are both compiled and executed. Then the proc univariate displays the moments of the sample distribution. In the picture of my frame, you can ignore the number of sample(s) and size of sample(s), textlabels and textentry boxes because I have not gotten to that step in my program yet. I have searched the web for a long time now and can't really find many examples creating applications using SCL. My code is kind of long, so if any one can help I would appreciate it. My goal is to get: proc sgplot and proc univariate html ouput into the component windows, but I have only been able to get listing output in my external file viewer control (I might need to try a different component, such as graph output control). Any help would be nice. Thanks. dcl num rc;
dcl list messageList = {};
dcl char(10) distribution,
char(2) command;
Init:
rc = insertc(messageList, 'To create the report, please select a distribution');
rc = filename('out', ' ', 'temp');
ReportViewer._showEndOfFile('no');
return;
CreateRptButton:
if ReportViewer.fileref ne ' ' then ReportViewer.fileref = ' ';
distribution = distComboBox.selectedItem;
if distribution ne ' ' then do;
submit continue;
proc printto print=out new;
ods noproctitle;
options nodate nonumber nocenter;
%macro Uniform;
%local i k;
data work.uniform;
call streaminit(1234);
%do i=1 %to 10;
%do k=1 %to 10;
Sample&k=10*rand("Uniform");
%end;
output;
%end;
run;
%mend Uniform;
%Uniform
proc transpose data=work.uniform out=work.uniform1 name=sample;
run;
%macro usd;
%local i;
data work.usd(drop=col1-col10);
set work.uniform1;
%do i=1 %to 10;
sample_mean=mean(of col1-col10);
%end;
run;
%mend usd;
%usd
ods select moments;
proc univariate data= work.usd;
var sample_mean;
run;
proc printto;
run;
options date number center;
endsubmit;
ReportViewer.fileref='out';
end;
else command = messagebox(messageList, '!', 'O', 'Application warning message');
return;
Term:
messageList = dellist(messageList);
reportViewer.fileref = ' ';
rc = filename('out', ' ');
return;
... View more