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
Opal | Level 21

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
Opal | Level 21

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
Opal | Level 21

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

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

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