Usage Note 17257: Tab delimited data is not read into SAS correctly when accessed through
Code window in SAS® Enterprise Guide®
If you open existing code using File->Open->Code or copy/paste code into
the Code window and this code contains tabs in a datalines/cards
section, you may receive an error similar to the following when you run
the code:
NOTE: Invalid data for variable in line xx x-xx.
This error occurs because the tabs are interpreted as character fields
when the code is executed and the data cannot be read in as specified.
This occurs whether or not the following options are set (checked) in
SAS Enterprise Guide: Tools -> Options -> SAS Programs -> Editor
Options -> "Insert spaces for tabs" and/or "Replace tabs with spaces on
file open".
A user can use one of the following workarounds to circumvent the
problem:
1) An INFILE statement specifying a tab (represented by the hexadecimal
constant '09'x) as the delimiter can be added to the existing code to
produce the correct output table.
data a;
infile datalines dlm='09'x;
input a b c;
datalines;
1 2 3
4 5 6
;
run;
2) Replace all of the tabs in the code by following these steps:
1. Select the tab between "00-05" and "1".
2. Select Edit->Replace.
"Find text" should be a tab character.
3. Set "Replace with" to a space.
4. Click the [Replace All] button.
The "Insert spaces for tabs" option is honored only when new datastep
code is entered into the Code window. It will automatically convert the
tabs typed in the code to the number spaces specified in the Tab size
box.
Operating System and Release Information
SAS System | SAS Enterprise Guide | Microsoft Windows XP Professional | 4.1 | | 9.1 TS1M3 SP1 | |
Microsoft Windows 2000 Professional | 4.1 | | 9.1 TS1M3 SP1 | |
*
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: | medium |
Date Modified: | 2013-09-23 11:51:25 |
Date Created: | 2006-03-15 12:45:53 |