Usage Note 50929: SAS® Studio does not convert tabs to spaces by default when reading in-stream data using DATALINES or CARDS
SAS Studio does not convert tabs to spaces by default when reading tab-delimited in-stream data using DATALINES or CARDS. The Enhanced Editor and Program Editor in Base SAS® and the editor in SAS® Enterprise Guide® do convert tabs to spaces. Running unmodified code that worked in those editors might give unexpected results in SAS Studio. The default delimiter used by the INPUT statement is a space. Because the tab characters are not converted to spaces in SAS Studio, the program tries to read the tabs as data. There might be notes in the log indicating invalid data.
To read in-stream data with tab delimiters using SAS® Studio 3.6, do the following:
To read in-stream data with tab delimiters using releases prior to SAS Studio 3.6, do one of the following:
Click the Full Code tab in this note to see an example.
Operating System and Release Information
SAS System | SAS Studio | Windows Millennium Edition (Me) | | |
Windows 7 Ultimate x64 | | |
Windows 7 Ultimate 32 bit | | |
Windows 7 Professional x64 | | |
Windows 7 Professional 32 bit | | |
Windows 7 Home Premium x64 | | |
Windows 7 Home Premium 32 bit | | |
Windows 7 Enterprise x64 | | |
Windows 7 Enterprise 32 bit | | |
Microsoft Windows XP Professional | | |
Microsoft Windows Server 2012 Std | | |
Microsoft Windows Server 2012 R2 Std | | |
Microsoft Windows Server 2012 R2 Datacenter | | |
Microsoft Windows Server 2012 Datacenter | | |
Microsoft Windows Server 2008 for x64 | | |
Microsoft Windows Server 2008 R2 | | |
Microsoft Windows Server 2008 | | |
Microsoft Windows Server 2003 for x64 | | |
Microsoft Windows Server 2003 Standard Edition | | |
Microsoft Windows Server 2003 Enterprise Edition | | |
Microsoft Windows Server 2003 Datacenter Edition | | |
Microsoft Windows NT Workstation | | |
Microsoft Windows 2000 Professional | | |
Microsoft Windows 2000 Server | | |
Microsoft Windows 2000 Datacenter Server | | |
Microsoft Windows 2000 Advanced Server | | |
Microsoft Windows 95/98 | | |
Microsoft Windows 8.1 Pro 32-bit | | |
Microsoft Windows 8.1 Pro | | |
Microsoft Windows 8.1 Enterprise x64 | | |
Microsoft Windows 8.1 Enterprise 32-bit | | |
Microsoft Windows 8 Pro x64 | | |
Microsoft Windows 8 Pro 32-bit | | |
Microsoft Windows 8 Enterprise x64 | | |
Microsoft Windows 8 Enterprise 32-bit | | |
Microsoft® Windows® for x64 | | |
Windows Vista | | |
Windows Vista for x64 | | |
64-bit Enabled AIX | | |
64-bit Enabled Solaris | | |
HP-UX IPF | | |
Linux for x64 | | |
Solaris for x64 | | |
*
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.
/* The results will not be reproduced by cutting and pasting this code because the tab */
/* characters are not maintained. You can type this code into the editors and replace */
/* the space between the two numbers with a tab character to see the difference. */
/* Code using the default delimiter of space. This is required when using tab-delimited */
/* in-stream data in the Enhanced Editor or Program Editor. */
data one;
input x y;
datalines;
1 1.234
2 4.555
3 8.999
;
run;
/* Code specifying that the delimiter is a tab. This is required when reading tab-delimited */
/* in-stream data using SAS Studio. */
data one;
infile datalines dlm = '09'x;
input x y;
datalines;
1 1.234
2 4.555
3 8.999
;
run;
Date Modified: | 2013-09-17 16:49:56 |
Date Created: | 2013-08-30 16:11:52 |