<?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: reading data in sas in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/reading-data-in-sas/m-p/275170#M593</link>
    <description>&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Sat, 04 Jun 2016 08:45:33 GMT</pubDate>
    <dc:creator>gnrslasher37</dc:creator>
    <dc:date>2016-06-04T08:45:33Z</dc:date>
    <item>
      <title>reading data in sas</title>
      <link>https://communities.sas.com/t5/SAS-Studio/reading-data-in-sas/m-p/275156#M590</link>
      <description>&lt;P&gt;how can i read the following data in .DAT file into sas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;02:05:00:104 20050103|OB_CHANGE|2_YEAR|912828DF4|1|20|ADD &amp;nbsp; |6|26D3918E86D75FF7|25558|20|A|20|20|&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jun 2016 05:43:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/reading-data-in-sas/m-p/275156#M590</guid>
      <dc:creator>gnrslasher37</dc:creator>
      <dc:date>2016-06-04T05:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: reading data in sas</title>
      <link>https://communities.sas.com/t5/SAS-Studio/reading-data-in-sas/m-p/275162#M591</link>
      <description>What output would you like to see ?</description>
      <pubDate>Sat, 04 Jun 2016 06:47:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/reading-data-in-sas/m-p/275162#M591</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-06-04T06:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: reading data in sas</title>
      <link>https://communities.sas.com/t5/SAS-Studio/reading-data-in-sas/m-p/275167#M592</link>
      <description>&lt;P&gt;Looks like data step and use DLM='|'.&lt;/P&gt;
&lt;P&gt;If you want an actual datetime value you should read that first bit as character and then parse it for time and date bits.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Being occasionally lazy I might be tempted to use the import wizard on that file and then copy the generated code from the log and modify any missed details. Use a large value for the number of rows to guess, if practical the number of lines in the file.&lt;/P&gt;
&lt;P&gt;Your first variable will most like be text as I doubt format is a standard datetime one SAS will recognize.&lt;/P&gt;
&lt;P&gt;Parsing the date time bit would look something like:&lt;/P&gt;
&lt;P&gt;time = input(scan(dtvariablename,1),time.);&lt;/P&gt;
&lt;P&gt;date = input(scan(dtvaraiblename,2), yymmdd.);&lt;/P&gt;
&lt;P&gt;and to get an actual datetime variable&lt;/P&gt;
&lt;P&gt;datetime = dhms(date, 0,0,time);&lt;/P&gt;
&lt;P&gt;You should apply appropriate formats to date, time and datetime suitable to your needs otherwise the values will be pretty meaningless to most humans looking at the data.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jun 2016 07:46:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/reading-data-in-sas/m-p/275167#M592</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-06-04T07:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: reading data in sas</title>
      <link>https://communities.sas.com/t5/SAS-Studio/reading-data-in-sas/m-p/275170#M593</link>
      <description>&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jun 2016 08:45:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/reading-data-in-sas/m-p/275170#M593</guid>
      <dc:creator>gnrslasher37</dc:creator>
      <dc:date>2016-06-04T08:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: reading data in sas</title>
      <link>https://communities.sas.com/t5/SAS-Studio/reading-data-in-sas/m-p/275179#M595</link>
      <description>&lt;P&gt;Here is the exact SAS code :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data work.datupld ;
infile "/home/anoopyuvaa0/xyz.dat" dlm='|';
length Timestamp $22;
input Timestamp $ var1 $ var2 $ var3 $ num1 num2 var4 $ num3 var5 $ num4 num5 var6 $ num6 num7;
run;
proc print data = work.datupld;
run;&lt;/PRE&gt;&lt;P&gt;Please see the attached screenshot for the output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12624i2BE86FBA9549508F/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="sascode.png" title="sascode.png" /&gt;</description>
      <pubDate>Sat, 04 Jun 2016 11:17:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/reading-data-in-sas/m-p/275179#M595</guid>
      <dc:creator>anoop1409</dc:creator>
      <dc:date>2016-06-04T11:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: reading data in sas</title>
      <link>https://communities.sas.com/t5/SAS-Studio/reading-data-in-sas/m-p/275224#M600</link>
      <description>&lt;P&gt;Thank you for posting your exact solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For what it may be worth DAT is not any standard file structure. The contents can be a text and delimited as yours of proprietary binary. The first DAT files I ran into had the dat stand for "digital audio tape" and were for sound...&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jun 2016 04:48:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/reading-data-in-sas/m-p/275224#M600</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-06-05T04:48:28Z</dc:date>
    </item>
  </channel>
</rss>

