<?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: Problem with tab delimited data file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-tab-delimited-data-file/m-p/567526#M159602</link>
    <description>&lt;P&gt;The following code read your data just fine:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import file="&amp;amp;sasforum.\datasets\Begg.txt" out=begg dbms=tab;
getnames=no;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Your collegue's file probably had its tab characters replaced with spaces, somewhere along the way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could read both files with simple list input, using option expandtabs:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data begg;
infile "&amp;amp;sasforum.\datasets\Begg.txt" expandtabs;
input var1-var23;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 20 Jun 2019 04:44:08 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2019-06-20T04:44:08Z</dc:date>
    <item>
      <title>Problem with tab delimited data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-tab-delimited-data-file/m-p/567451#M159569</link>
      <description>&lt;P&gt;Good day, friends, I am a novice with SAS and I need your help!&amp;nbsp; A colleague sent me a SAS-based program he developed and a tab-delimited data file (.dat) for use with his program.&amp;nbsp; He specified that the data &lt;STRONG&gt;MUST&lt;/STRONG&gt; be in this format.&amp;nbsp; I thought I was following his instructions to the letter - tab delimited, .dat.&amp;nbsp; However, I was able to get his data file to work with his program but not my data file.&amp;nbsp; I keep getting a warning that there were missing values; however, I don't see any missing values :(. I imported both files into SAS v 9.4 to see if I could compare the two files.&amp;nbsp; I thought, perhaps, if I could compare the two files, I would be able to fix mine.&amp;nbsp; The results were fascinating.&amp;nbsp; SAS said my file had the correct number of cases and the presumed number of variables.&amp;nbsp; However, SAS said his had the correct number of cases but only one variable!!!&amp;nbsp; He clearly had more than one - according to my calculations he had 15!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached the results from the SAS log if anyone is interested in looking at it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your advice on why the two files are different and how to get mine to be more compliance is most welcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 20:26:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-tab-delimited-data-file/m-p/567451#M159569</guid>
      <dc:creator>CH33</dc:creator>
      <dc:date>2019-06-19T20:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with tab delimited data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-tab-delimited-data-file/m-p/567456#M159571</link>
      <description>I think it's going to be hard to tell you exactly what's going on here without a bit more information about what you're doing.  Some suggestions: post your code in your post (as text in the post, not as an attachment); describe the file (what it has in it), and describe what's wrong with your file.  I'm not sure that "missing values" is a problem - it depends on the code.</description>
      <pubDate>Wed, 19 Jun 2019 20:48:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-tab-delimited-data-file/m-p/567456#M159571</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2019-06-19T20:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with tab delimited data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-tab-delimited-data-file/m-p/567458#M159572</link>
      <description>&lt;P&gt;Hello Snoopy 369 and thank you for your reply.&amp;nbsp; You have hit part of the nail squarely on the head.&amp;nbsp; I do not know what the problem is with the file - I have no idea!&amp;nbsp; All I get is there are missing values.&amp;nbsp; I can send you my .dat file but I do not feel that I can share my colleagues file because I do not have his permission.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 20:56:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-tab-delimited-data-file/m-p/567458#M159572</guid>
      <dc:creator>CH33</dc:creator>
      <dc:date>2019-06-19T20:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with tab delimited data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-tab-delimited-data-file/m-p/567466#M159576</link>
      <description>Your code to import said file? File seems fine at first glance so likely one of you is reading it wrong. Please show both sets of code.</description>
      <pubDate>Wed, 19 Jun 2019 21:47:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-tab-delimited-data-file/m-p/567466#M159576</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-19T21:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with tab delimited data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-tab-delimited-data-file/m-p/567510#M159596</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I imported both files into SAS v 9.4&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;This does not really tell us what you did.&amp;nbsp; Did you run a PROC IMPORT step?&amp;nbsp; Where is the code (log) of what you ran?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In general if PROC IMPORT read his file as only having one variable then that means you did not tell SAS to use the right delimiter character.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It is also possible that someone edited the text file with a program (like the SAS program editor) that changed the tabs into spaces.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 02:55:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-tab-delimited-data-file/m-p/567510#M159596</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-06-20T02:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with tab delimited data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-tab-delimited-data-file/m-p/567526#M159602</link>
      <description>&lt;P&gt;The following code read your data just fine:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import file="&amp;amp;sasforum.\datasets\Begg.txt" out=begg dbms=tab;
getnames=no;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Your collegue's file probably had its tab characters replaced with spaces, somewhere along the way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could read both files with simple list input, using option expandtabs:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data begg;
infile "&amp;amp;sasforum.\datasets\Begg.txt" expandtabs;
input var1-var23;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Jun 2019 04:44:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-tab-delimited-data-file/m-p/567526#M159602</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-06-20T04:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with tab delimited data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-tab-delimited-data-file/m-p/567696#M159673</link>
      <description>&lt;P&gt;Please paste the code you used to read the data file into a code box opened using the forum's {I} or "running man" icons.&lt;/P&gt;
&lt;P&gt;Note that your conversion of the log to&amp;nbsp;&lt;STRONG&gt;picture&lt;/STRONG&gt; in that&amp;nbsp;DOCX format cut off lines as well as not actually showing the code. Also paste LOG entries the same way into a code box. Pictures are a lousy way to share code because we can't copy and make edits to what might be correct or even highlight text to bring things to attention.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The bit in that picture that says&lt;/P&gt;
&lt;P&gt;The data set WORK.ADULT has 683 observations and 1 variables.&lt;/P&gt;
&lt;P&gt;makes be very suspicious that the delimiter in the data was not the one used on the infile statement.&lt;/P&gt;
&lt;P&gt;And it appears that you may have used PROC import which is&amp;nbsp;not reliable for duplicating variable properties because each time you use proc import the procedure guesses about the content.&lt;/P&gt;
&lt;P&gt;If you used PROC import then paste the ENTIRE Proc Import code as well as the data step generated by the proc that appears in the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the data is not particularly sensitive copy 5 to 10 rows, including the header and paste them into a code box opened with the {I} icon so we can see what is actually in the data to compare with your code.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Do not paste directly into the message&lt;/STRONG&gt; window. The forum software will reformat text removing blanks and possibly replacing tabs as well as sometimes inserting HTML tags.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 22:19:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-tab-delimited-data-file/m-p/567696#M159673</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-20T22:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with tab delimited data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-tab-delimited-data-file/m-p/567733#M159692</link>
      <description>&lt;P&gt;CH33,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another approach might be to use an editor that show the actual ASCII codes (e.g. UltraEdit).&amp;nbsp; Then you can truly see the differences in the files.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 18:51:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-tab-delimited-data-file/m-p/567733#M159692</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2019-06-20T18:51:54Z</dc:date>
    </item>
  </channel>
</rss>

