<?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: How can i rename variables for tab delimited file? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-can-i-rename-variables-for-tab-delimited-file/m-p/388675#M65952</link>
    <description>&lt;P&gt;Look at the note from the log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;NOTE: The data set WORK.PUMPKIN1 has 7 observations and 1 variables.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's only one variable in the data set, probably var1.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Aug 2017 02:19:32 GMT</pubDate>
    <dc:creator>SuzanneDorinski</dc:creator>
    <dc:date>2017-08-17T02:19:32Z</dc:date>
    <item>
      <title>How can i rename variables for tab delimited file?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-i-rename-variables-for-tab-delimited-file/m-p/388669#M65951</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*Set up title on line 1;
TITLE1 "STATS 301(glee217/749750841): &amp;amp;sysuserid";
*Specify SAS library for storing permanent SAS datasets;
LIBNAME stats301 "H:\stats301\A2";

proc import out=Work.Pumpkin1
datafile="H:\stats301\A2\Pumpkin.txt"
DBMS=tab REPLACE;
getnames=no;
datarow=1;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;i imported the data by using the SAS code above,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and next i wanted to rename variables but it only gave one variable for the "first_name".&lt;/P&gt;&lt;P&gt;(Here is the code for renaming variables)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;**renaming variables;
data Work.Pumpkin1;
set work.Pumpkin1;
rename var1=first_name
var2=last_name
var3=age
var4=category
var5=date
var6=judge1
var7=judge2
var8=judge3
var9=judge4
var10=judge5;
run;


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the error is saying:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;WARNING: The variable var2 in the DROP, KEEP, or RENAME list has never been referenced.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;WARNING: The variable var3 in the DROP, KEEP, or RENAME list has never been referenced.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;WARNING: The variable var4 in the DROP, KEEP, or RENAME list has never been referenced.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;WARNING: The variable var5 in the DROP, KEEP, or RENAME list has never been referenced.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;WARNING: The variable var6 in the DROP, KEEP, or RENAME list has never been referenced.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;WARNING: The variable var7 in the DROP, KEEP, or RENAME list has never been referenced.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;WARNING: The variable var8 in the DROP, KEEP, or RENAME list has never been referenced.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;WARNING: The variable var9 in the DROP, KEEP, or RENAME list has never been referenced.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;WARNING: The variable var10 in the DROP, KEEP, or RENAME list has never been referenced.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: There were 7 observations read from the data set WORK.PUMPKIN1.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: The data set WORK.PUMPKIN1 has 7 observations and 1 variables.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: DATA statement used (Total process time):&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;real time 0.01 seconds&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;cpu time 0.00 seconds&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can i fix this problem? i would attach the file for my output too.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 00:34:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-i-rename-variables-for-tab-delimited-file/m-p/388669#M65951</guid>
      <dc:creator>glee217</dc:creator>
      <dc:date>2017-08-17T00:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: How can i rename variables for tab delimited file?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-i-rename-variables-for-tab-delimited-file/m-p/388675#M65952</link>
      <description>&lt;P&gt;Look at the note from the log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;NOTE: The data set WORK.PUMPKIN1 has 7 observations and 1 variables.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's only one variable in the data set, probably var1.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 02:19:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-i-rename-variables-for-tab-delimited-file/m-p/388675#M65952</guid>
      <dc:creator>SuzanneDorinski</dc:creator>
      <dc:date>2017-08-17T02:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: How can i rename variables for tab delimited file?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-i-rename-variables-for-tab-delimited-file/m-p/388676#M65953</link>
      <description>&lt;P&gt;You cannot rename variables that do not exist. Most likely your file is NOT tab delimited.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But why are you using PROC IMPORT if you already know what is in the file? &amp;nbsp;Just read the file directly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 02:33:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-i-rename-variables-for-tab-delimited-file/m-p/388676#M65953</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-08-17T02:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: How can i rename variables for tab delimited file?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-i-rename-variables-for-tab-delimited-file/m-p/388679#M65954</link>
      <description>&lt;P&gt;Oh there must be something wrong in my code!&lt;/P&gt;&lt;P&gt;This is original txt file. And i need to create different variables,&lt;/P&gt;&lt;P&gt;which represent first name, last name, age, category, date, scores from 5 different judges.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you kindly help me out for this :/?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 02:42:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-i-rename-variables-for-tab-delimited-file/m-p/388679#M65954</guid>
      <dc:creator>glee217</dc:creator>
      <dc:date>2017-08-17T02:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can i rename variables for tab delimited file?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-i-rename-variables-for-tab-delimited-file/m-p/388681#M65955</link>
      <description>Oh there must be something wrong in my code!&lt;BR /&gt;This is original txt file. And i need to create different variables,&lt;BR /&gt;which represent first name, last name, age, category, date, scores from 5 different judges.&lt;BR /&gt;&lt;BR /&gt;Would you kindly help me out for this :/?&lt;BR /&gt;i attached txt file on my different comment.</description>
      <pubDate>Thu, 17 Aug 2017 02:44:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-i-rename-variables-for-tab-delimited-file/m-p/388681#M65955</guid>
      <dc:creator>glee217</dc:creator>
      <dc:date>2017-08-17T02:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can i rename variables for tab delimited file?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-i-rename-variables-for-tab-delimited-file/m-p/388683#M65956</link>
      <description>&lt;P&gt;Your text file appears to be comma delimited, not tab delimited.&lt;/P&gt;
&lt;P&gt;To read such a somple text file just define your variables. Attach any required INFORMATs or FORMATs. And then read the variable in.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data pumpkin;
  infile 'pumpkin.txt' dsd truncover ;
  length first_name last_name $40 age 8  category $8 date judge1-judge5 8;
  informat date mmddyy. ;
  format date yymmdd10. ;
  input first_name -- judge5 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I prefer to display dates in YMD order to avoid the confusion that using either MDY or DMY order can cause.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 02:51:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-i-rename-variables-for-tab-delimited-file/m-p/388683#M65956</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-08-17T02:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can i rename variables for tab delimited file?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-i-rename-variables-for-tab-delimited-file/m-p/388689#M65957</link>
      <description>&lt;P&gt;As said already and looking at your text file - it is not tab delimited buy comma delimited.&lt;/P&gt;
&lt;P&gt;When you define DBMS=TAB the&lt;U&gt; whole row enters one variable.&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change your code t, from&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import out=Work.Pumpkin1
datafile="H:\stats301\A2\Pumpkin.txt"
DBMS=tab REPLACE;
getnames=no;
datarow=1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;into:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import out=Work.Pumpkin1
datafile="H:\stats301\A2\Pumpkin.txt"
DBMS=dlm REPLACE;
Delimiter = ',';
getnames=no;
datarow=1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 04:50:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-i-rename-variables-for-tab-delimited-file/m-p/388689#M65957</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-08-17T04:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: How can i rename variables for tab delimited file?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-can-i-rename-variables-for-tab-delimited-file/m-p/389233#M66016</link>
      <description>&lt;P&gt;Thank you everyone! i worked it out!&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2017 21:10:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-can-i-rename-variables-for-tab-delimited-file/m-p/389233#M66016</guid>
      <dc:creator>glee217</dc:creator>
      <dc:date>2017-08-18T21:10:53Z</dc:date>
    </item>
  </channel>
</rss>

