<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Tab delimiter error with Datalines in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Tab-delimiter-error-with-Datalines/m-p/302754#M64249</link>
    <description>&lt;P&gt;When I copy your code into SAS EG it works.&amp;nbsp;Why not just replace all tabs with a space and then run this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
 infile datalines dlm=' ' dsd truncover;
 input a b c d e;
 datalines;
1 2 3 4 5
2 3  5 6
3   6 7
4 5 6 7
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Are you using SAS Enterprise Guide? Sometimes it can interpret tabs as characters and the data doesn't get read in as expected. If you're in SAS EG, go to tools-&amp;gt;options-&amp;gt;SAS Programs-&amp;gt;Editor Options and uncheck the "Replace tabs with spaces on file open" if it is checked. Then re-open the file and rerun. This may be the issue.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Oct 2016 19:24:43 GMT</pubDate>
    <dc:creator>JediApprentice</dc:creator>
    <dc:date>2016-10-05T19:24:43Z</dc:date>
    <item>
      <title>Tab delimiter error with Datalines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tab-delimiter-error-with-Datalines/m-p/302748#M64244</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a very basic question. &amp;nbsp;Why does this code not work? &amp;nbsp;The spaces between the numbers in the datalines below are tabs. &amp;nbsp;I'm using SAS 9.4 on Windows 7 64-bit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
	infile datalines dlm = '09'x dsd truncover;
	input a b c d e;
	datalines;
1	2	3	4	5
2	3		5	6
3			6	7
4	5	6	7
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I omit both the dlm = '09'x and the dsd options, it runs, but gives incorrect results, viewing two or more delimiters as just one.&lt;/P&gt;
&lt;P&gt;If I add only dsd, it doesn't seem to register any delimiters at all, and views each row as one 17-character long text string.&lt;/P&gt;
&lt;P&gt;If I add only dlm = '09'x, it also doesn't recognize any delimiters and views each row as one 80-character long text string.&lt;/P&gt;
&lt;P&gt;If I add both, it treats it the same as only dsd.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Am I using the wrong code to define a tab delimiter? &amp;nbsp;Using a separate file work. &amp;nbsp;The issue is only with DATALINES. &amp;nbsp;Any help would be appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;152878  data a;
152879      infile datalines /*dlm = '09'x dsd*/ truncover;
152880      input a b c d e;
152881      datalines;

NOTE: The data set WORK.A has 4 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


152886  ;
152887  run;

152888  data a;
152889      infile datalines /*dlm = '09'x*/ dsd truncover;
152890      input a b c d e;
152891      datalines;

NOTE: Invalid data for a in line 152892 1-17.
RULE:         ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
152892        1   2   3   4   5
a=. b=. c=. d=. e=. _ERROR_=1 _N_=1
NOTE: Invalid data for a in line 152893 1-17.
152893        2   3       5   6
a=. b=. c=. d=. e=. _ERROR_=1 _N_=2
NOTE: Invalid data for a in line 152894 1-17.
152894        3           6   7
a=. b=. c=. d=. e=. _ERROR_=1 _N_=3
NOTE: Invalid data for a in line 152895 1-13.
152895        4   5   6   7
a=. b=. c=. d=. e=. _ERROR_=1 _N_=4
NOTE: The data set WORK.A has 4 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds


152896  ;
152897  run;

152898  data a;
152899      infile datalines dlm = '09'x /*dsd*/ truncover;
152900      input a b c d e;
152901      datalines;

NOTE: Invalid data for a in line 152902 1-80.
RULE:         ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
152902        1   2   3   4   5
a=. b=. c=. d=. e=. _ERROR_=1 _N_=1
NOTE: Invalid data for a in line 152903 1-80.
152903        2   3       5   6
a=. b=. c=. d=. e=. _ERROR_=1 _N_=2
NOTE: Invalid data for a in line 152904 1-80.
152904        3           6   7
a=. b=. c=. d=. e=. _ERROR_=1 _N_=3
NOTE: Invalid data for a in line 152905 1-80.
152905        4   5   6   7
a=. b=. c=. d=. e=. _ERROR_=1 _N_=4
NOTE: The data set WORK.A has 4 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds


152906  ;
152907  run;

152908  data a;
152909      infile datalines dlm = '09'x dsd truncover;
152910      input a b c d e;
152911      datalines;

NOTE: Invalid data for a in line 152912 1-17.
RULE:         ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
152912        1   2   3   4   5
a=. b=. c=. d=. e=. _ERROR_=1 _N_=1
NOTE: Invalid data for a in line 152913 1-17.
152913        2   3       5   6
a=. b=. c=. d=. e=. _ERROR_=1 _N_=2
NOTE: Invalid data for a in line 152914 1-17.
152914        3           6   7
a=. b=. c=. d=. e=. _ERROR_=1 _N_=3
NOTE: Invalid data for a in line 152915 1-13.
152915        4   5   6   7
a=. b=. c=. d=. e=. _ERROR_=1 _N_=4
NOTE: The data set WORK.A has 4 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.03 seconds


152916  ;
152917  run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Oct 2016 18:17:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tab-delimiter-error-with-Datalines/m-p/302748#M64244</guid>
      <dc:creator>Kastchei</dc:creator>
      <dc:date>2016-10-05T18:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Tab delimiter error with Datalines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tab-delimiter-error-with-Datalines/m-p/302752#M64247</link>
      <description>&lt;P&gt;Is it possible that your delimiter in your datalines is actually consecutive spaces and not a true TAB?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I copy your syntax and insert in tabs myself.. the version using dlm='09'x (the true TAB unicode character) works.&lt;/P&gt;
&lt;P&gt;When I replace those tabs with spaces and run using dlm='09'x, I get the same errors you are describing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So it seems to me that your session is interpreting what you think are TABs as just consecutive spaces.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't have access to SAS running on Windows 64.. I am testing on SAS EG running on a Linux server, but nonetheless that is what I'm seeing.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 18:44:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tab-delimiter-error-with-Datalines/m-p/302752#M64247</guid>
      <dc:creator>JoshB</dc:creator>
      <dc:date>2016-10-05T18:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Tab delimiter error with Datalines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tab-delimiter-error-with-Datalines/m-p/302754#M64249</link>
      <description>&lt;P&gt;When I copy your code into SAS EG it works.&amp;nbsp;Why not just replace all tabs with a space and then run this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
 infile datalines dlm=' ' dsd truncover;
 input a b c d e;
 datalines;
1 2 3 4 5
2 3  5 6
3   6 7
4 5 6 7
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Are you using SAS Enterprise Guide? Sometimes it can interpret tabs as characters and the data doesn't get read in as expected. If you're in SAS EG, go to tools-&amp;gt;options-&amp;gt;SAS Programs-&amp;gt;Editor Options and uncheck the "Replace tabs with spaces on file open" if it is checked. Then re-open the file and rerun. This may be the issue.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 19:24:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tab-delimiter-error-with-Datalines/m-p/302754#M64249</guid>
      <dc:creator>JediApprentice</dc:creator>
      <dc:date>2016-10-05T19:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Tab delimiter error with Datalines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tab-delimiter-error-with-Datalines/m-p/302756#M64250</link>
      <description>&lt;P&gt;Why not keep it simple? There is no good reason to use tabs with datalines as they are not visible in the program. Just use column-style input.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 19:01:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tab-delimiter-error-with-Datalines/m-p/302756#M64250</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-10-05T19:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Tab delimiter error with Datalines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tab-delimiter-error-with-Datalines/m-p/302760#M64252</link>
      <description>&lt;P&gt;The problem is DMS.&amp;nbsp; When you click run the editor or the submitter or something is expanding the tables.&amp;nbsp; If you run in EG or batch it will work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may want to check options to figure is you can change that behavior.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 19:19:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tab-delimiter-error-with-Datalines/m-p/302760#M64252</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2016-10-05T19:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Tab delimiter error with Datalines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tab-delimiter-error-with-Datalines/m-p/302766#M64257</link>
      <description>&lt;P&gt;It may not hurt to try putting . for the missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
	infile datalines  truncover;
	input a b c d e;
	datalines;
1	2	3	4	5
2	3	.	5	6
3	.	.	6	7
4	5	6	7       .
;
run &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to simplify list style input.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 19:30:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tab-delimiter-error-with-Datalines/m-p/302766#M64257</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-05T19:30:31Z</dc:date>
    </item>
  </channel>
</rss>

