<?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 proc import vs data step input??? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-import-vs-data-step-input/m-p/49700#M10362</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Art.&amp;nbsp; When i looked at the code created by proc import, sas switched the last two columns compared to the data step I was using.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Aug 2011 16:21:55 GMT</pubDate>
    <dc:creator>asishgautam</dc:creator>
    <dc:date>2011-08-17T16:21:55Z</dc:date>
    <item>
      <title>proc import vs data step input???</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-vs-data-step-input/m-p/49698#M10360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a very large file showing subhourly generation by various customers.&amp;nbsp; This file is stored as a csv file.&amp;nbsp; The fields are: ID, dtid, engo, engo_f. ID is the customer id, dtid is a date/time of measurement, engo is generation amount, engo_f is a flag variable.&amp;nbsp; This is how the fields are suppose to be ordered per the documentation I was given from our consultant (please note this contract ended some time ago).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the program i used to read this file with a data step:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Engo ;&lt;/P&gt;&lt;P&gt; attrib dtid format = datetime16. ;&lt;/P&gt;&lt;P&gt; infile '--blankedout---.csv' dlm = ',' dsd&amp;nbsp; obs = 1000000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; firstobs = 2 missover ;&lt;/P&gt;&lt;P&gt; input Id $ Dtid datetime16. Engo Engof $ ;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After submitting this program, I seem to be getting correct values for ID, Dtid, and engo_f.&amp;nbsp; I keep getting missing values for the field "engo".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to read the same file with proc import, I get much better results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options obs = 1000000 ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc import datafile = '--blankedout---.csv'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; out = Engo replace dbms = csv ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; guessingrows = 125 ;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Except for one strange thing: the column order under proc import becomes (well this is how the output file looks): ID, Dtid, engo_f, engo.&amp;nbsp; My question: 1.) did our consultant make a mistake in their documentation and 2.) if the correct order of the fields are as givne in the output of the second program, then why did the field "engo_f" get picked up correctly in the first program?&amp;nbsp; Are there some options that I am missing and that I should use in the first program?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 15:24:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-vs-data-step-input/m-p/49698#M10360</guid>
      <dc:creator>asishgautam</dc:creator>
      <dc:date>2011-08-17T15:24:05Z</dc:date>
    </item>
    <item>
      <title>proc import vs data step input???</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-vs-data-step-input/m-p/49699#M10361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I'm starting to sound like a broken record, but I think that your easiest option for discovering the answer would be to &lt;/P&gt;&lt;P&gt;grab the code that proc import creates and simply see how it differs from the code that you submitted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A nice artice on the method can be found at: &lt;A class="jive-link-external-small" href="http://www2.sas.com/proceedings/sugi30/038-30.pdf" style="font-size: 12px; outline-style: none; color: #0e66ba;"&gt;http://www2.sas.com/proceedings/sugi30/038-30.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It could simply be a difference in the order of the fields, the field types and/or modifiers that proc import used but you didn't.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 15:36:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-vs-data-step-input/m-p/49699#M10361</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-17T15:36:10Z</dc:date>
    </item>
    <item>
      <title>proc import vs data step input???</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-vs-data-step-input/m-p/49700#M10362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Art.&amp;nbsp; When i looked at the code created by proc import, sas switched the last two columns compared to the data step I was using.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 16:21:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-vs-data-step-input/m-p/49700#M10362</guid>
      <dc:creator>asishgautam</dc:creator>
      <dc:date>2011-08-17T16:21:55Z</dc:date>
    </item>
    <item>
      <title>proc import vs data step input???</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-vs-data-step-input/m-p/49701#M10363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then I'd have to think you were provided with an incorrect layout to begin with as proc import would only be reading the variable names from the first record.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 16:25:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-vs-data-step-input/m-p/49701#M10363</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-17T16:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: proc import vs data step input???</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-vs-data-step-input/m-p/49702#M10364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you need colon modifier for your input statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;input Id $&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dtid&amp;nbsp; &lt;STRONG&gt; :&amp;nbsp; &lt;/STRONG&gt;datetime16.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Engo Engof $ ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because your origin code is formatted input method( i.e. datetime16.), so it will eat everything,even delimiter,&lt;/P&gt;&lt;P&gt;you need add : to prevent it happen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or remove datatime16. in the input statement, since you already has attrib to format Dtid variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2011 05:17:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-vs-data-step-input/m-p/49702#M10364</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-08-18T05:17:27Z</dc:date>
    </item>
  </channel>
</rss>

