Usage Note 41925: How to read an encoded comma, tab, or delimited file using PROC IMPORT
To read an encoded external file using PROC IMPORT, the external file will need to be allocated using the FILENAME statement. On the FILENAME statement the ENCODING="xxx" where "xxx" is the type of encoded file and LRECL= option will used. The ENCODING= option will tell SAS what type of encoded external file is being read. The LRECL= option will need to be set to 32767. Otherwise, you will receive a default LRECL of 256.
Here is a sample of the FILENAME statement with the 2 options along with the PROC IMPORT code reading a unicode encoded external file:
filename temp 'c:\temp\qualityinfo.csv' encoding="unicode" lrecl=32767;
proc import datafile=temp out=quality dbms=csv replace;
run;
Operating System and Release Information
SAS System | Base SAS | Microsoft Windows XP Professional | 9.1 TS1M3 | |
Windows Vista | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 | |
Microsoft Windows NT Workstation | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 | |
Microsoft Windows 2000 Professional | 9.1 TS1M3 | |
Microsoft Windows 2000 Server | 9.1 TS1M3 | |
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M3 | |
Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 | |
Microsoft Windows 2000 Advanced Server | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M3 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M3 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M3 | |
Windows Vista for x64 | 9.1 TS1M3 | |
64-bit Enabled AIX | 9.1 TS1M3 | |
64-bit Enabled HP-UX | 9.1 TS1M3 | |
64-bit Enabled Solaris | 9.1 TS1M3 | |
HP-UX IPF | 9.1 TS1M3 | |
Linux | 9.1 TS1M3 | |
OpenVMS Alpha | 9.1 TS1M3 | |
Tru64 UNIX | 9.1 TS1M3 | |
*
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: | Common Programming Tasks ==> Reading and Writing External Data ==> with PROC IMPORT
|
Date Modified: | 2010-12-24 10:42:02 |
Date Created: | 2010-12-21 14:47:21 |