BookmarkSubscribeRSS Feed
veblen
Calcite | Level 5
In doing some ETL development I am finding that SAS isn't allowing me to use some special characters (e.g., parentheses and single quotes) in some places (e.g., file descriptions, file names).

Is there a complete list of non-usable special characters and what/if any escapes there are for their use.

(Please inform me if this is posted in the wrong forum.)

Please let me know if more info is required.

Thanks Thanks, but I have answered this.

Message was edited by: veblen
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
SAS file references and file names have strict rules about what a valid SAS name can be. For example, this is a valid column or variable name: AGE_GROUP_1 however 1_AGE_GROUP is an invalid name because it starts with a number and SAS names cannot start with numbers. Valid SAS names can ONLY contain numbers, letters and underscores (spaces not allowed) and must start with a letter or underscore. So this would also be a valid variable or column name: _1_AGE_GROUP.

However, due to the fact that some systems do allow special characters or spaces in a name, for example, SAS also allows you to use "name literals" tokens or strings to reference variables. Some references are:
http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000998953.htm
http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001392879.htm

For example, as a name literal, it shows in the documentation that you could read in a column or variable with a name of [pre] '$ Amount Budgeted'n or 'Amount Spent'n [/pre] Note that in this syntax construction the whole string is quoted and is immediately followed by an n, which indicates that the string is a name literal.

You might want to open a track with Tech Support for more thorough help on this issue, they can look at all your code and your operating system configuration and make specific recommendations.

cynthia
veblen
Calcite | Level 5
My apologies for the slow response, but THANKS for the assistance Cynthia.

Your advice and the links came in handy and it is highly appreciated.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1868 views
  • 0 likes
  • 2 in conversation