Usage Note 34275: You cannot change the case of a variable name in a DATA step with the RENAME statement
You cannot change the case of a variable name in a DATA step with the RENAME statement. However, you can change the case of a SAS variable name after the variable has been defined in the DATA step by using the VALIDVARNAME=UPCASE option in an OPTIONS statement. For example:
options validvarname=upcase;
Operating System and Release Information
| SAS System | Base SAS | 64-bit Enabled Solaris | 9.2 TS1M0 | |
| HP-UX IPF | 9.2 TS1M0 | |
| Linux | 9.2 TS1M0 | |
| z/OS | 9.2 TS1M0 | |
| Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | |
| Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | |
| Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | |
| Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | |
| Microsoft® Windows® for x64 | 9.2 TS1M0 | |
| Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | |
| Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS1M0 | |
| Linux for x64 | 9.2 TS1M0 | |
| 64-bit Enabled HP-UX | 9.2 TS1M0 | |
| 64-bit Enabled AIX | 9.2 TS1M0 | |
| Windows Vista | 9.2 TS1M0 | |
| Microsoft Windows XP Professional | 9.2 TS1M0 | |
| Microsoft Windows Server 2003 Standard Edition | 9.2 TS1M0 | |
| OpenVMS on HP Integrity | 9.2 TS1M0 | |
| Solaris for x64 | 9.2 TS1M0 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
options validvarname=upcase;
data two;
stuff = 1;
myvar = 0;
run;
proc print data=two label;
title 'show variable label - same as variable name'; run;
proc print data=two;
title 'show variable name - should be upper case '; run;
show variable label - same as variable name 1
10:28 Monday, December 22, 2008
Obs STUFF MYVAR
1 1 0
show variable name - should be upper case 2
10:28 Monday, December 22, 2008
Obs STUFF MYVAR
1 1 0
| Type: | Usage Note |
| Priority: | low |
| Topic: | SAS Reference ==> DATA Step SAS Reference ==> System Options ==> VALIDVARNAME= Data Management
|
| Date Modified: | 2008-12-22 15:04:40 |
| Date Created: | 2008-12-19 15:18:06 |