<?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 one dynamic field in proc import in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25197#M5693</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, there's 4 others.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Mar 2012 14:22:58 GMT</pubDate>
    <dc:creator>podarum</dc:creator>
    <dc:date>2012-03-08T14:22:58Z</dc:date>
    <item>
      <title>one dynamic field in proc import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25195#M5691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp; I'm trying to figure out a way to deal with a filed from a monthly file that I have to import that is dynamic.&amp;nbsp; What I mean is the file is the same every month except one field changes name.. out of 6 fileds there is a field wiht the name as a date (that changes every month).. for example from _0111130 (eg. Nov 30, 2011) to _0111231 (eg. Dec 31, 2012).. and I want it to always name it 'Pairs'.....&amp;nbsp; any way of letting sas know that no matter what that field is called to always name it 'Pairs' ?&amp;nbsp;&amp;nbsp; thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 14:05:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25195#M5691</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2012-03-08T14:05:24Z</dc:date>
    </item>
    <item>
      <title>one dynamic field in proc import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25196#M5692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it the only field that begins with an underscore?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 14:18:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25196#M5692</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-03-08T14:18:27Z</dc:date>
    </item>
    <item>
      <title>one dynamic field in proc import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25197#M5693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, there's 4 others.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 14:22:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25197#M5693</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2012-03-08T14:22:58Z</dc:date>
    </item>
    <item>
      <title>one dynamic field in proc import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25198#M5694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Is it the only field that begins with an underscore followed by a number?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 14:25:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25198#M5694</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-03-08T14:25:03Z</dc:date>
    </item>
    <item>
      <title>one dynamic field in proc import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25199#M5695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; No, they all do..&lt;/P&gt;&lt;P&gt;_01&lt;/P&gt;&lt;P&gt;_0110831&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;_0111231&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;_1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 14:29:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25199#M5695</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2012-03-08T14:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: one dynamic field in proc import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25200#M5696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are you importing from? Do the fields change order? If not then see if you can import without the names and then just rename the automatic variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise query the metadata to find the name of the field that is NOT one of the five known field names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select name into :fieldnm &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from dictionary.columns &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where libname='WORK' and memname='IMPORT'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and name not in ('ONE','TWO','THREE','FOUR','FIVE')&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set import(rename=(&amp;amp;fieldnm=SIX));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 14:30:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25200#M5696</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-03-08T14:30:07Z</dc:date>
    </item>
    <item>
      <title>one dynamic field in proc import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25201#M5697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; From a .txt file .. the fields will not change order just value&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 14:32:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25201#M5697</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2012-03-08T14:32:42Z</dc:date>
    </item>
    <item>
      <title>one dynamic field in proc import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25202#M5698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it is a text file with known variable order why would you use IMPORT to begin with?&lt;/P&gt;&lt;P&gt;Use the FIRSTOBS option on the INFILE statement to skip the column headers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; infile 'myfile.txt' firstobs=2 dsd dlm=',' truncover ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; input one two three four five six;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 14:37:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25202#M5698</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-03-08T14:37:27Z</dc:date>
    </item>
    <item>
      <title>one dynamic field in proc import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25203#M5699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with Tom.&amp;nbsp; However, since I just posted the following as a possible answer to a related question, thought you might want to know about it if you have ALREADY imported all of the data and have SAS files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname mydata "c:\art\test";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data mydata.productid;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set sashelp.class (rename=(sex=productid));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data mydata.salesamount;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set sashelp.class (rename=(sex=salesamount));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dsid=open("mydata.productid","i"); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('proc datasets library=mydata nolist;'); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('&amp;nbsp;&amp;nbsp;&amp;nbsp; modify productid;'); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('&amp;nbsp;&amp;nbsp;&amp;nbsp; rename '||varname(dsid,2)||'=errorcolumn;'); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('quit;'); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc=close(dsid); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dsid=open("mydata.salesamount","i"); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('proc datasets library=mydata nolist;'); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('&amp;nbsp;&amp;nbsp;&amp;nbsp; modify salesamount;'); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('&amp;nbsp;&amp;nbsp;&amp;nbsp; rename '||varname(dsid,2)||'=errorcolumn;'); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('quit;'); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc=close(dsid); &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 15:09:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25203#M5699</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-03-08T15:09:50Z</dc:date>
    </item>
    <item>
      <title>one dynamic field in proc import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25204#M5700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks guys.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 15:23:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/one-dynamic-field-in-proc-import/m-p/25204#M5700</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2012-03-08T15:23:50Z</dc:date>
    </item>
  </channel>
</rss>

