for example,
data con;
x = 1;
run;
causes the error message
'ungültiger membername für datei' means something like 'invalid member name for file'.
i've only found a list of reserved words for the macro facility.
Hello @Quodly,
I get the same error message (in English, though): ERROR: Invalid member name for file WORK.CON.DATA.
In various places of the SAS(R) 9.4 Companion for Windows you find a sentence like "The words AUX, CON, NUL, PRN, LPT1 - LPT9, and COM1 - COM9 are reserved words under Windows" followed by the instruction not to use any of these reserved words as
But, indeed, I haven't found the corresponding statement for dataset names. So, thanks for pointing that out.
Edit: Actually, "filenames" comes very close: Windows (7) wouldn't even allow you to name any file aux, con, nul, etc. Not surprisingly, .sas7bdat files, i.e. SAS datasets, aren't an exception.
See the section "Rules for SAS Data Set Names, View Names, and Item Store Names" in the link Names in the SAS Language.
What error message do you get? The code looks fine.
There aren't any reserved words for SAS dataset names. They just must follow the naming convention.
Not sure what's going wrong with your statement. It works for me.
Make sure that you retest this in a fresh new SAS session to not get impacted by some upstream issues. This can sometimes lead to "wrong" error messages.
28 data con;
29 x = 1;
30 run;
NOTE: The data set WORK.CON has 1 observations and 1 variables.
Addendum:
Above code has been executed under Rhel so it's not in contradiction with what @FreelanceReinh writes.
I wasn't aware of the Windows restrictions. Learned something new
Hello @Quodly,
I get the same error message (in English, though): ERROR: Invalid member name for file WORK.CON.DATA.
In various places of the SAS(R) 9.4 Companion for Windows you find a sentence like "The words AUX, CON, NUL, PRN, LPT1 - LPT9, and COM1 - COM9 are reserved words under Windows" followed by the instruction not to use any of these reserved words as
But, indeed, I haven't found the corresponding statement for dataset names. So, thanks for pointing that out.
Edit: Actually, "filenames" comes very close: Windows (7) wouldn't even allow you to name any file aux, con, nul, etc. Not surprisingly, .sas7bdat files, i.e. SAS datasets, aren't an exception.
On a mildly related note, do not use these names as data set names:
SET MERGE UPDATE RETAIN
They won't cause a problem when you create the data set, but they usually will cause a problem when a DATA step tries to read in the data later. ("Usually" means it depends on the values for a system option.) The intent behind this was to prevent this program from wiping out a valid SAS data set because of a missing semicolon:
data want
set huge.permanent_dataset;
run;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.