BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
GKati
Pyrite | Level 9

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,

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

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.

View solution in original post

5 REPLIES 5
Astounding
PROC Star

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.

Reeza
Super User

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;

GKati
Pyrite | Level 9

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. 

Reeza
Super User

Without a log I can't say. According to SAS docs the code is correct. 

Astounding
PROC Star

I suspect that the error message comes from this combination:

 

  • The options on the OUTPUT statement (nocol, etc.) suppress all the printed output.
  • Because of that, the OUT= option is required.

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 2961 views
  • 2 likes
  • 3 in conversation