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

Good afternoon.

 

I am having an issue that I'm hoping someone can help me with. I have a very simple proc freq that fails with the log entry ERROR: User does not have appropriate authorization level for file WORK.FRELIST1.UTILITY in the log. It appears that I come up with the error only when I have two by groups in the proc freq. Preceding datasets all generate into the work library as appropriate and normal but this one dataset will not.

 

I've never seen this error before and I don't even know what FRELIST1.UTILITY is for.

 

Thanks for any help out there.

 
Example 1 does not run:
proc freq data = have_01;
by var_1 var_2;
  table var_1 * var_2 * var_3 / out = want_01 noprint;
run;
 
Example 2 will run:
proc freq data = have_01;
by /*var_1*/ var_2;
table /*var_1*/ * var_2 * var_3 / out = want_01  noprint;
run;

 

 

Example 3 will also run:
proc freq data = have_01;
by var_1 var_2;
table var_1*var_2*var_3 / out = want_01  noprint;
run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

How big is your data set? As in how many observations? Utility files often come up when large sets are used.

Is your have_01 sorted by the variables?

 

You should show the log. Especially for examples one and three as the code you  show is identical unless you have inserted some non-visible character somewhere in example one. Copy your LOG text including code an all messages, open a text box on the forum using the </> icon above the message window and paste the text. The text box is important as the main message windows will reformat text that is pasted an may have removed something that SAS doesn't like.

 

BTW, the BY variables will be on the output set even when not on the TABLES statement, so you might as well drop that part of the tables statement.

 

 

View solution in original post

7 REPLIES 7
ballardw
Super User

How big is your data set? As in how many observations? Utility files often come up when large sets are used.

Is your have_01 sorted by the variables?

 

You should show the log. Especially for examples one and three as the code you  show is identical unless you have inserted some non-visible character somewhere in example one. Copy your LOG text including code an all messages, open a text box on the forum using the </> icon above the message window and paste the text. The text box is important as the main message windows will reformat text that is pasted an may have removed something that SAS doesn't like.

 

BTW, the BY variables will be on the output set even when not on the TABLES statement, so you might as well drop that part of the tables statement.

 

 

Jeff_DOC
Pyrite | Level 9

The HAVE_01 dataset is a bit over 1 million rows. It is sorted by the by variables before the proc freq step.

 

The log doesn't contain much of anything except the error and that 30,822 observations read from the data set HAVE_01.

 

The thing that really caught my attention is that using only one by variable allows the code to run but two will not.

SASKiwi
PROC Star

If this is being run on a SAS server then this really is a question for your SAS admin to answer. It may possibly be utility file size issue given it only occurs for multiple levels. They should be able to monitor SAS WORK space while you run your program.

FreelanceReinh
Jade | Level 19

Hello @Jeff_DOC,

 

Have you tried ballardw's suggestion to omit the BY variables in the TABLES statement? This should have no impact at all on the output datasets. But it avoids the warnings

WARNING: Variable var_1 already exists on file WORK.WANT_01.
WARNING: Variable var_2 already exists on file WORK.WANT_01.

in the log and it simplifies the code (maybe also the internal processing of PROC FREQ) and helps avoiding typos/syntax errors such as


table /*var_1*/ * var_2 * var_3 / out = want_01  noprint;
Jeff_DOC
Pyrite | Level 9

Hi ballardw and FreelanceReinh.

 

Yes, I have tried removing the by group statement and the code will run. However, the use would like the percentages by the by groups included in the data. Removing the by statement allows it to run but gives me a percentage over the data set not within the groups.

 

Thank you both.

FreelanceReinh
Jade | Level 19

@Jeff_DOC wrote:

Yes, I have tried removing the by group statement and the code will run. However, the use would like the percentages by the by groups included in the data. Removing the by statement allows it to run but gives me a percentage over the data set not within the groups.

The suggestion was not to omit the BY statement but to omit the BY variables in the TABLES statement. This should have no impact at all on the output datasets. In particular, the percentages will not change.

Jeff_DOC
Pyrite | Level 9

Thank you FreelanceReinh for calling my attention to that. I had not made that change and since you mentioned it I did it and the code works well. I really appreciate you drawing my attention to that part otherwise I would have not seen it. 

 

I wish I could assign percentages for solutions but since it was ballardw who came up with it I gave it to them even though I couldn't have done it without you.

 

Thank you again.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 7 replies
  • 526 views
  • 3 likes
  • 4 in conversation