Help using Base SAS procedures

ERROR 73-322: Expecting an OUT.

Accepted Solution Solved
Reply
Contributor
Posts: 45
Accepted Solution

ERROR 73-322: Expecting an OUT.

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,


Accepted Solutions
Solution
‎02-08-2017 09:24 AM
Super User
Posts: 5,077

Re: ERROR 73-322: Expecting an OUT.

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


All Replies
Solution
‎02-08-2017 09:24 AM
Super User
Posts: 5,077

Re: ERROR 73-322: Expecting an OUT.

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.

Super User
Posts: 17,775

Re: ERROR 73-322: Expecting an OUT.

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;

Contributor
Posts: 45

Re: ERROR 73-322: Expecting an OUT.

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. 

Super User
Posts: 17,775

Re: ERROR 73-322: Expecting an OUT.

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

Super User
Posts: 5,077

Re: ERROR 73-322: Expecting an OUT.

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.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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