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.
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.
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.
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.
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.
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;
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.
@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.
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.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.