Simple Histogram<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Hi all,
Here is my code. I was attempting to make a histogram using one of the sample files included with JMP.
dtA = Open("C:\Program Files\SAS\JMP\9\Support Files English\Sample Data\Students1.JMP", Invisible);
histogram = (dtA << Distribution(
Nominal Distribution( Column(:age) ),
Where ( :sex == "M"),
Invisible
));
close (histogram, save("histogram_students.jrp"));
Here is the error I get:
The file cannot be opened for writing, opening for reading only.
invalid argument{233}
in access or evaluation of 'Close' , Close( histogram, save( "histogram_students.jrp" ) )
Any help would be great. Thanks!
Re: Simple HistogramThanks PMroz!
I used this line to save it as a png instead:
histogram << save picture("", png);
Re: Simple HistogramThe close function in this context is for datasets. You have a graphical object you're trying to save. This code will work, but it saves to a MS Word file, not a JRP file:
dtA = Open( "$sample_data\Students1.JMP", Invisible );
histogram = (dtA << Distribution(
Nominal Distribution( Column( :age ) ),
Where( :sex == "M" ),
Invisible
)
);
histogram << save msword("", native) ;
histogram << close window();
close(dta, nosave);