BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Quodly
Obsidian | Level 7

for example,

data con;
  x = 1;
run;

causes the error message

screenshot.jpg

 

'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.

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

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.

View solution in original post

4 REPLIES 4
PeterClemmensen
Tourmaline | Level 20

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.

Patrick
Opal | Level 21

@Quodly 

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 Smiley Happy 

FreelanceReinh
Jade | Level 19

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.

Astounding
PROC Star

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;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 4 replies
  • 2161 views
  • 4 likes
  • 5 in conversation