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;

 

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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