<?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: Data not showing when importing delimited file in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Data-not-showing-when-importing-delimited-file/m-p/575549#M12885</link>
    <description>&lt;P&gt;As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;says, can't really "skip" columns in delimited data. But you can read unwanted data into a variable and then drop that variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Suppose the Time variable is actually the 5th column, that means you would want to ignore the 2nd, 3rd and 4th columns.&lt;/P&gt;
&lt;P&gt;This is one way to do that:&lt;/P&gt;
&lt;PRE&gt;data WORK.THIRTY;
   infile 'D:\XX\P_02\30\New folder\LBDS2023-20190630-005517Z-DataLog_User.dat' delimiter='09'x DSD truncover lrecl=32767 firstobs=2 ;
   informat dummy $1.;
   input DATE :$10. dummy dummy dummy TIME :$15. H20 :$20.;
   drop dummy;
run;&lt;/PRE&gt;
&lt;P&gt;Place the dummy variable in the column position of any column you don't want to read. You also only need to include up to the last column desired.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The informat for dummy is one character so that it will "read" almost anything and not generate an error&amp;nbsp; whereas a numeric could well have issues with the character values.&lt;/P&gt;</description>
    <pubDate>Mon, 22 Jul 2019 19:37:35 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-07-22T19:37:35Z</dc:date>
    <item>
      <title>Data not showing when importing delimited file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-not-showing-when-importing-delimited-file/m-p/575474#M12868</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to get data from a dat file to show in sas. There are multiple columns in the dat file but i only want three. Below is the code I used but when I open the resulting file in SAS only the first column is showing data. Any suggestions would be great. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data WORK.THIRTY;&lt;BR /&gt;infile 'D:\XX\P_02\30\New folder\LBDS2023-20190630-005517Z-DataLog_User.dat' delimiter='09'x DSD truncover lrecl=32767 firstobs=2 ;&lt;BR /&gt;input DATE :$10. TIME :$15. H20 :$20.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 17:18:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-not-showing-when-importing-delimited-file/m-p/575474#M12868</guid>
      <dc:creator>annie_1</dc:creator>
      <dc:date>2019-07-22T17:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Data not showing when importing delimited file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-not-showing-when-importing-delimited-file/m-p/575500#M12874</link>
      <description>&lt;P&gt;Please show a couple of the lines from the file.&amp;nbsp; If you cannot figure out how to open a text file and copy a couple of lines just use this code to have SAS show the lines in the LOG. Then copy the lines from the log.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
infile 'D:\XX\P_02\30\New folder\LBDS2023-20190630-005517Z-DataLog_User.dat'  obs=3;
input;
list;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To paste the text into the forum click on the Insert Code button one the menu bar. Looks like {i}. Then paste the lines into the window that pops-up.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 17:37:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-not-showing-when-importing-delimited-file/m-p/575500#M12874</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-22T17:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Data not showing when importing delimited file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-not-showing-when-importing-delimited-file/m-p/575501#M12875</link>
      <description>&lt;P&gt;You cannot selectively import columns unless you have a fixed width file. You have to read all the data and then filter out the columns after the fact. Try reading in all the columns and then keeping only the ones you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/281773"&gt;@annie_1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am trying to get data from a dat file to show in sas. &lt;STRONG&gt;There are multiple columns in the dat file but i only want three.&lt;/STRONG&gt; Below is the code I used but when I open the resulting file in SAS only the first column is showing data. Any suggestions would be great. Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data WORK.THIRTY;&lt;BR /&gt;infile 'D:\XX\P_02\30\New folder\LBDS2023-20190630-005517Z-DataLog_User.dat' delimiter='09'x DSD truncover lrecl=32767 firstobs=2 ;&lt;BR /&gt;input DATE :$10. TIME :$15. H20 :$20.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 17:42:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-not-showing-when-importing-delimited-file/m-p/575501#M12875</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-22T17:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Data not showing when importing delimited file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-not-showing-when-importing-delimited-file/m-p/575549#M12885</link>
      <description>&lt;P&gt;As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;says, can't really "skip" columns in delimited data. But you can read unwanted data into a variable and then drop that variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Suppose the Time variable is actually the 5th column, that means you would want to ignore the 2nd, 3rd and 4th columns.&lt;/P&gt;
&lt;P&gt;This is one way to do that:&lt;/P&gt;
&lt;PRE&gt;data WORK.THIRTY;
   infile 'D:\XX\P_02\30\New folder\LBDS2023-20190630-005517Z-DataLog_User.dat' delimiter='09'x DSD truncover lrecl=32767 firstobs=2 ;
   informat dummy $1.;
   input DATE :$10. dummy dummy dummy TIME :$15. H20 :$20.;
   drop dummy;
run;&lt;/PRE&gt;
&lt;P&gt;Place the dummy variable in the column position of any column you don't want to read. You also only need to include up to the last column desired.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The informat for dummy is one character so that it will "read" almost anything and not generate an error&amp;nbsp; whereas a numeric could well have issues with the character values.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 19:37:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-not-showing-when-importing-delimited-file/m-p/575549#M12885</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-07-22T19:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Data not showing when importing delimited file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-not-showing-when-importing-delimited-file/m-p/575573#M12893</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the below code to import the file&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;"proc import datafile='D:\XX\P_02\30\New folder\LBDS2023-20190630-005517Z-DataLog_User.dat' dbms=dlm out= work.THIRTY replace;&lt;BR /&gt;&amp;nbsp;delimiter='09'X;&lt;BR /&gt;&amp;nbsp;getnames=yes;&lt;BR /&gt;&amp;nbsp;guessingrows=6000;&lt;BR /&gt;run;"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but when I ran it no data showed and even the headers did not show completely (there are about 20 columns). Below is a snip of what the output looked like. So I used F4 to recall the generated DATA step. Which I edited to the code that was in the first post. I also attached a snip of what the dat file looks like in note pad&lt;/P&gt;&lt;P&gt;&lt;IMG width="299" height="444" src="https://communities.sas.com/t5/image/serverpage/image-id/31201iEA488F79BDA0FDFE/image-size/large?v=1.0&amp;amp;px=-1" border="0" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG2.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31202i507DBD13B0C1D1D6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG2.PNG" alt="Capture.PNG2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 20:12:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-not-showing-when-importing-delimited-file/m-p/575573#M12893</guid>
      <dc:creator>annie_1</dc:creator>
      <dc:date>2019-07-22T20:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Data not showing when importing delimited file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-not-showing-when-importing-delimited-file/m-p/575574#M12894</link>
      <description>&lt;P&gt;Run the code I posted before to dump the first 3 lines of the file into the log. THen copy the lines from the log. From the start of the data step to the end of the notes after the step.&amp;nbsp; Do NOT post a photograph of your screen. Post the actual lines of text from the SAS log.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 20:15:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-not-showing-when-importing-delimited-file/m-p/575574#M12894</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-22T20:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: Data not showing when importing delimited file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-not-showing-when-importing-delimited-file/m-p/575588#M12895</link>
      <description>I don't think you have a tab delimted file, I think you have what's called a fixed format file and you  need to use a data step to read it.&lt;BR /&gt;&lt;BR /&gt;Example #2 here:&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/inputting-data-into-sas/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/inputting-data-into-sas/&lt;/A&gt;</description>
      <pubDate>Mon, 22 Jul 2019 20:55:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-not-showing-when-importing-delimited-file/m-p/575588#M12895</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-22T20:55:29Z</dc:date>
    </item>
  </channel>
</rss>

