<?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 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-import/m-p/644046#M192322</link>
    <description>&lt;P&gt;I'm trying to import a few excel files and when I do so I want to change the column/variable names but I'm not sure how to do that. Right now they're too long or just showing up as b,c,d,etc. Heres my import code.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;import&lt;/STRONG&gt; out=facts5&lt;/P&gt;&lt;P&gt;datafile="C:\Users\Downloads\SAS2\2019_FACTS_Table_A-2.5.xlsx" DBMS=xlsx replace;&lt;/P&gt;&lt;P&gt;getnames=YES;&lt;/P&gt;&lt;P&gt;datarow=&lt;STRONG&gt;6&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Apr 2020 18:29:49 GMT</pubDate>
    <dc:creator>matoma</dc:creator>
    <dc:date>2020-04-29T18:29:49Z</dc:date>
    <item>
      <title>proc import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import/m-p/644046#M192322</link>
      <description>&lt;P&gt;I'm trying to import a few excel files and when I do so I want to change the column/variable names but I'm not sure how to do that. Right now they're too long or just showing up as b,c,d,etc. Heres my import code.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;import&lt;/STRONG&gt; out=facts5&lt;/P&gt;&lt;P&gt;datafile="C:\Users\Downloads\SAS2\2019_FACTS_Table_A-2.5.xlsx" DBMS=xlsx replace;&lt;/P&gt;&lt;P&gt;getnames=YES;&lt;/P&gt;&lt;P&gt;datarow=&lt;STRONG&gt;6&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 18:29:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import/m-p/644046#M192322</guid>
      <dc:creator>matoma</dc:creator>
      <dc:date>2020-04-29T18:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: proc import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import/m-p/644048#M192323</link>
      <description>&lt;P&gt;You have a couple of choices.&lt;/P&gt;
&lt;P&gt;If you have already imported the data you can change properties of variables like name and label with Proc Datasets and a modify statement.&lt;/P&gt;
&lt;P&gt;Or you can modify the spreadsheet before importing it.&lt;/P&gt;
&lt;P&gt;Or save the spreadsheet to a text format such as CSV and write a data step to name the variables as needed. Proc Import could be used to build a template of the code needed to read the csv by importing, copying the code generated from the log to the editor and then editing the informat, format and input statements to a nicer name using search and replace (carefully).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following code would rename variables in Facts5 from A, B , C to Variable1, Variable2 and Variable3&lt;/P&gt;
&lt;PRE&gt;proc datasets library=work;
   modify  facts5  ;
   rename a = variable1
          b = variable2
          c = variable3
   ;
run;&lt;BR /&gt;quit;&lt;/PRE&gt;
&lt;P&gt;If you have multiple datasets than need the same change you use multiple MODIFY statements to indicate each data set but could copy the rename statement for each set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 18:46:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import/m-p/644048#M192323</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-04-29T18:46:52Z</dc:date>
    </item>
  </channel>
</rss>

