BookmarkSubscribeRSS Feed
Kamal5522
Obsidian | Level 7
As we know that we can not use special character in name of data set and variable etc because special character are used as operators so they are not allowed in name,however number can be used in name however name can not be started with number.
My question is why we can not start dataset and variable name with number, actually I want to know the logic behind it ?
2 REPLIES 2
Kurt_Bremser
Super User

The SAS interpreter and data step compiler treat every digit encountered after a separator (blank, comma, semicolon, linefeed etc) as the start of a number. The rules for names in the SAS language are very similar to other programming languages (eg C, PL/1, PASCAL) and aid compiler/interpreter design.

Ksharp
Super User

Maybe You could use dataset/variable name start with number.

Try this option.

 

options validmemname=extend validvarname=any;

 

 

SAS Innovate 2025: Register Now

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!

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
  • 2 replies
  • 2335 views
  • 2 likes
  • 3 in conversation