<?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: Always Replacing Variable names in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850752#M37292</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437885"&gt;@Kirito1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I just want to change variable names while importing a csv without doing the following&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;RENAME = (old1=new1 old2=new2 .... oldk=newk);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;is there a way through which I could change variable names without considering what variables are there in the csv file.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There is absolutely NO need to RENAME variables when reading a csv file. A csv file is read with INFILE&amp;nbsp; and INPUT in a DATA step, and the variable names are defined in the INPUT statement.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Dec 2022 09:18:48 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-12-22T09:18:48Z</dc:date>
    <item>
      <title>Always Replacing Variable names</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850729#M37283</link>
      <description>&lt;P&gt;For example: Data should contain the following variables.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CUSTOMER_ID, AGE, MOB_NO.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;but the variable names in the csv are like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;cusTomer No, aGe, Number &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;All the variable names are always differing due the the guy delivering me the data.&lt;/P&gt;&lt;P&gt;Now what I want is regardless of what data I receive I should always discard the first row and assign my own variables without even considering what variables were there in the CSV.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is helpful when we know that data is always same only the variable names differ so we need not to go and change variable names in excel and then save it and then import it, rather we just import the file with the pre-defined variable names that we always want.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 06:49:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850729#M37283</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2022-12-22T06:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Always Replacing Variable names</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850730#M37284</link>
      <description>&lt;P&gt;That's why you never use PROC IMPORT for text files, but write the data step yourself.&lt;/P&gt;
&lt;P&gt;Copy the data step code created by PROC IMPORT from the log, and change the variable names.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 06:53:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850730#M37284</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-12-22T06:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Always Replacing Variable names</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850731#M37285</link>
      <description>If the data is in .xls format then what we can do.</description>
      <pubDate>Thu, 22 Dec 2022 06:56:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850731#M37285</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2022-12-22T06:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: Always Replacing Variable names</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850733#M37287</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437885"&gt;@Kirito1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;If the data is in .xls format then what we can do.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Save as a csv file and read it with a data step.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 06:59:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850733#M37287</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-12-22T06:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Always Replacing Variable names</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850735#M37288</link>
      <description>Can we use infile for that without considering what file format is data in?</description>
      <pubDate>Thu, 22 Dec 2022 07:19:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850735#M37288</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2022-12-22T07:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Always Replacing Variable names</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850745#M37289</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437885"&gt;@Kirito1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Can we use infile for that without considering what file format is data in?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, infile and input statement must match the structure of the file.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 08:42:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850745#M37289</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-12-22T08:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Always Replacing Variable names</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850748#M37290</link>
      <description>&lt;P&gt;INFILE and INPUT in a DATA step can be used for text files; Excel files need PROC IMPORT or LIBNAME EXCEL/XLSX.&lt;/P&gt;
&lt;P&gt;The results of reading Excel files directly are inconsistent at best; it is always better to save the data to a text file and read that with a DATA step.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 08:53:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850748#M37290</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-12-22T08:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Always Replacing Variable names</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850751#M37291</link>
      <description>&lt;P&gt;I just want to change variable names while importing a csv without doing the following&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;RENAME = (old1=new1 old2=new2 .... oldk=newk);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;is there a way through which I could change variable names without considering what variables are there in the csv file.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 09:15:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850751#M37291</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2022-12-22T09:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Always Replacing Variable names</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850752#M37292</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437885"&gt;@Kirito1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I just want to change variable names while importing a csv without doing the following&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;RENAME = (old1=new1 old2=new2 .... oldk=newk);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;is there a way through which I could change variable names without considering what variables are there in the csv file.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There is absolutely NO need to RENAME variables when reading a csv file. A csv file is read with INFILE&amp;nbsp; and INPUT in a DATA step, and the variable names are defined in the INPUT statement.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 09:18:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850752#M37292</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-12-22T09:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Always Replacing Variable names</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850754#M37293</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437885"&gt;@Kirito1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I just want to change variable names while importing a csv without doing the following&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;RENAME = (old1=new1 old2=new2 .... oldk=newk);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;is there a way through which I could change variable names without considering what variables are there in the csv file.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If the position of the variables are constant and only the names are set randomly, you could ignore the names (getnames=no) during proc import and use the rename option.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 09:43:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Always-Replacing-Variable-names/m-p/850754#M37293</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-12-22T09:43:37Z</dc:date>
    </item>
  </channel>
</rss>

