Usage Note 33137: Finding what SAS® considers punctuation, and compressing them out easily in SAS 9.1.3 and above
The code below shows how to determine what SAS considers punctuation by using the ANYPUNCT function and a loop. It also shows how to compress out all punctuation from a string using the new P option for the COMPRESS function that is available in SAS 9.1.3 and above.
data _null_;
do i = 0 to 255;
c = byte(i);
if anypunct(c) then do;
put c=;
nopunc=compress(c,,'p');
put nopunc=;
end;
end;
run;
Operating System and Release Information
| SAS System | Base SAS | z/OS | 9 TS M0 | |
| Microsoft® Windows® for 64-Bit Itanium-based Systems | 9 TS M0 | |
| Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9 TS M0 | |
| Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9 TS M0 | |
| Microsoft Windows 2000 Advanced Server | 9 TS M0 | |
| Microsoft Windows 2000 Datacenter Server | 9 TS M0 | |
| Microsoft Windows 2000 Server | 9 TS M0 | |
| Microsoft Windows 2000 Professional | 9 TS M0 | |
| Microsoft Windows NT Workstation | 9 TS M0 | |
| Microsoft Windows Server 2003 Datacenter Edition | 9 TS M0 | |
| Microsoft Windows Server 2003 Enterprise Edition | 9 TS M0 | |
| Microsoft Windows Server 2003 Standard Edition | 9 TS M0 | |
| Microsoft Windows XP Professional | 9 TS M0 | |
| 64-bit Enabled AIX | 9 TS M0 | |
| 64-bit Enabled HP-UX | 9 TS M0 | |
| 64-bit Enabled Solaris | 9 TS M0 | |
| HP-UX IPF | 9 TS M0 | |
| Linux | 9 TS M0 | |
| OpenVMS Alpha | 9 TS M0 | |
| Tru64 UNIX | 9 TS M0 | |
*
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.
| Type: | Usage Note |
| Priority: | |
| Topic: | SAS Reference ==> Functions ==> Character ==> ANYPUNCT SAS Reference ==> Functions ==> Character ==> COMPRESS
|
| Date Modified: | 2010-08-02 15:26:51 |
| Date Created: | 2008-09-03 14:39:43 |