Solved

Naming a variable with embedded blanks in SAS

Posted on 2014-10-21
2
224 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article describes some very basic things about SQL Server filegroups.
Read about achieving the basic levels of HRIS security in the workplace.
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…

707 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

13 Experts available now in Live!

Get 1:1 Help Now