Solved

Naming a variable with embedded blanks in SAS

Posted on 2014-10-21
2
232 Views
Last Modified: 2016-02-13
Experts,

I have a variable that I would like to  rename to output to Excel with embedded blanks.  Is there a way to do this?

ie    "Prov_Num "   to  "Provider Number"
0
Comment
Question by:morinia
  • 2
2 Comments
 
LVL 8

Accepted Solution

by:
ShannonEE earned 500 total points
ID: 40395767
Variables with embedded blanks and other weird characters are allowed in sas by using the N suffix after the variable name in quotes.

For example to rename   Prov_Num   to  "Provider Number"  in SAS dataset  temp.results  you could run a job similar to this

data results(rename=(Prov_Num = 'Provider Number'n Cust_Num='Customer Number'n));
    set results;
run;

Open in new window


However when you create the variable in your previous work, you could have done exactly what you previously did, except everywhere you defined and used Prov_Num you now specify 'Provider Number'n

Ian
0
 
LVL 8

Expert Comment

by:ShannonEE
ID: 40395771
Hi there morinia,

In addition to the above, I must caution you strongly that ms excel is an excellent piece of software to help you make mistakes.  This warning is over and above the warning that excel has a host of errors, some documented by ms and others ignored by ms.

Ian
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In today’s complex data management environments, it is not unusual for UNIX servers to be dedicated to a particular department, purpose, or database.  As a result, a SAS® data analyst often works with multiple servers, each with its own data storage…
Creating and Managing Databases with phpMyAdmin in cPanel.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now