BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
htsull_
Calcite | Level 5

Hi all,

 

I'm a new SAS user and I bumped into this snippet of code the other day and I'm trying to figure out why the by statment is like this:

 

 

PROC SORT DATA=DATA NODUPKEY;
	BY 'N°CLIENT'N;
RUN;

What exactly the 'variable'n do?

 

Thanks for your reply.

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

When you see a variable name like that it is a "name literal" and allows, when the option VALIDVARNAME=ANY is set, to use names that do not follow the standard SAS naming rules for variables. This option was added mostly for use with external databases that use different naming rules.

 

What the variable actually "does" is no different than any other variable. I just is referenced in code differently.

View solution in original post

2 REPLIES 2
ballardw
Super User

When you see a variable name like that it is a "name literal" and allows, when the option VALIDVARNAME=ANY is set, to use names that do not follow the standard SAS naming rules for variables. This option was added mostly for use with external databases that use different naming rules.

 

What the variable actually "does" is no different than any other variable. I just is referenced in code differently.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 293 views
  • 1 like
  • 3 in conversation