<?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 while importing raw data. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-while-importing-raw-data/m-p/489833#M127984</link>
    <description>&lt;P&gt;Your INPUT statement tells SAS to read EXACTLY 9 characters for each date string. But many of them are shorter than that. So you are leaving the column pointer in the wrong place.&lt;/P&gt;
&lt;P&gt;You need to use list mode input style instead.&lt;/P&gt;
&lt;P&gt;The simplest change is to add the : (colon) modifier before the format specifications in the INPUT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should also remove the .2 from the informat for duration.&amp;nbsp; That will cause SAS to divide any values it sees that do not include a period by 100 since you have told SAS that you expect the periods to be missing and that it should assume that the last two digits are the fractional part.&amp;nbsp; There is actually no need to tell SAS that it needs to use any special informat to read numbers. It already knows how to read numbers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also use an INFORMAT statement to let SAS know how to read the dates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So use something like this instead.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input date Call_duration @@;
format date date9.  Call_duration 8.2;
informat date date.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 25 Aug 2018 16:59:14 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2018-08-25T16:59:14Z</dc:date>
    <item>
      <title>Problem while importing raw data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-while-importing-raw-data/m-p/489832#M127983</link>
      <description>&lt;P&gt;I want to import raw data file&lt;/P&gt;&lt;P&gt;file :&lt;/P&gt;&lt;P&gt;1Sep11 389.00 1Oct11 491.00 1Nov11 370.00 1Dec11 335.00&lt;BR /&gt;2Sep11 423.00 2Oct11 478.00 2Nov11 407.00 2Dec11 442.00&lt;BR /&gt;3Sep11 482.00 3Oct11 300.00 3Nov11 303.00 3Dec11 372.00&lt;BR /&gt;4Sep11 407.00 4Oct11 405.00 4Nov11 398.00 4Dec11 465.00&lt;/P&gt;&lt;P&gt;I write a program:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FILENAME CALL '/folders/myfolders/sas data_8/Daily_call_duration.txt';&lt;/P&gt;&lt;P&gt;data output&lt;BR /&gt;infile call dlm=" ";&lt;BR /&gt;input date date9. Call_duration:8.2&amp;nbsp; @@;&lt;BR /&gt;format date date9.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the output i get&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 577px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/22780iADA8F69C86394B23/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I dont understand whats the issue with this,&lt;/P&gt;&lt;P&gt;Any help will appreciate&lt;/P&gt;</description>
      <pubDate>Sat, 25 Aug 2018 16:40:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-while-importing-raw-data/m-p/489832#M127983</guid>
      <dc:creator>deltaskipper</dc:creator>
      <dc:date>2018-08-25T16:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while importing raw data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-while-importing-raw-data/m-p/489833#M127984</link>
      <description>&lt;P&gt;Your INPUT statement tells SAS to read EXACTLY 9 characters for each date string. But many of them are shorter than that. So you are leaving the column pointer in the wrong place.&lt;/P&gt;
&lt;P&gt;You need to use list mode input style instead.&lt;/P&gt;
&lt;P&gt;The simplest change is to add the : (colon) modifier before the format specifications in the INPUT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should also remove the .2 from the informat for duration.&amp;nbsp; That will cause SAS to divide any values it sees that do not include a period by 100 since you have told SAS that you expect the periods to be missing and that it should assume that the last two digits are the fractional part.&amp;nbsp; There is actually no need to tell SAS that it needs to use any special informat to read numbers. It already knows how to read numbers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also use an INFORMAT statement to let SAS know how to read the dates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So use something like this instead.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input date Call_duration @@;
format date date9.  Call_duration 8.2;
informat date date.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Aug 2018 16:59:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-while-importing-raw-data/m-p/489833#M127984</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-08-25T16:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while importing raw data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-while-importing-raw-data/m-p/489834#M127985</link>
      <description>&lt;P&gt;Thanks Tom.&lt;/P&gt;&lt;P&gt;I really appreciate your help.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Aug 2018 16:56:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-while-importing-raw-data/m-p/489834#M127985</guid>
      <dc:creator>deltaskipper</dc:creator>
      <dc:date>2018-08-25T16:56:07Z</dc:date>
    </item>
  </channel>
</rss>

