DEAR SAS USERS,
PROC SORT DATA=randrandomsampleCLAIMS2;
BY YEAR;
RUN;
Proc freq data=randrandomsampleCLAIMS2;
BY YEAR;
tables claims*QUARTER /nocol nopercent norow;
output OUT=claimtypes N=freq;
Run;
I get "ERROR 73-322: Expecting an OUT." for the code above. There is an OUT in there. What's my error?
Thanks,
The syntax for creating an output data set in PROC FREQ is a little different:
Proc freq data=randrandomsampleCLAIMS2;
BY YEAR;
tables claims*QUARTER / noprint out=claimtypes;
Run;
It's easy enough to rename the variables if you want to.
The syntax for creating an output data set in PROC FREQ is a little different:
Proc freq data=randrandomsampleCLAIMS2;
BY YEAR;
tables claims*QUARTER / noprint out=claimtypes;
Run;
It's easy enough to rename the variables if you want to.
The syntax is different than proc means, but you're pretty close. The rest of the syntax are options but you don't get to rename the variable. What happens with the following code:
Proc freq data=randrandomsampleCLAIMS2;
BY YEAR;
tables claims*QUARTER /nocol nopercent norow;
output OUT=claimtypes N;
Run;
Thanks for the encouragement :-)) For some reason, this code didn't produce any output dataset. why is that? I also tried Astounding's and that produced a dataset. the difference between the two codes in minimal.
Without a log I can't say. According to SAS docs the code is correct.
I suspect that the error message comes from this combination:
It's true that the OUTPUT statement is added, but evidently PROC FREQ isn't smart enough to figure out that the combination is OK (no printed output, but using an OUTPUT statement). If you wanted to add an OUTPUT statement to save additional statistics, that ought to work.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.