<?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: NOTE: Variable X is uninitialize. WARNING: Variable X already exists on file WORK.mydataset. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/NOTE-Variable-X-is-uninitialize-WARNING-Variable-X-already/m-p/392899#M94597</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Rename statement and Rename option works little differently.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Rename statement would apply new name in the output dataset and not while processing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I suggest either use any of the below two option&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Option 1: Use data step option&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; data mydataset2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; set mydataset (&amp;nbsp; &amp;nbsp; rename=( A=date B=price C=volume));&lt;BR /&gt;&amp;nbsp; &amp;nbsp; price2=input(price,12.);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Option 2:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; data mydataset2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; set mydataset;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; rename A=date B=price C=volume;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; price2=input(B,12.);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Sep 2017 02:43:55 GMT</pubDate>
    <dc:creator>RahulG</dc:creator>
    <dc:date>2017-09-04T02:43:55Z</dc:date>
    <item>
      <title>NOTE: Variable X is uninitialize. WARNING: Variable X already exists on file WORK.mydataset.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOTE-Variable-X-is-uninitialize-WARNING-Variable-X-already/m-p/392894#M94594</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am encountering a very weird case. I am in an emergency so please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I first imported data from excel:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; proc import out=mydataset&lt;BR /&gt;&amp;nbsp; &amp;nbsp; datafile = 'C:\mypath\myfile.xlsx'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; dbms=xlsx replace;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; sheet = 'sheet1';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; datarow=3;getnames=no;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The imported dataset assigns A,B,C,... as variable names. Their format are all characters.&lt;/P&gt;&lt;P&gt;I need to convert the date variable into date format, and other variables into numericals. For example, I used&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; data mydataset2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; set mydataset;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; rename A=date B=price C=volume;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; price2=input(price,12.);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run this, I got&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: Numeric values have been converted to character values at the places given by:&lt;BR /&gt;(Line):(Column).&lt;BR /&gt;7675:14&lt;BR /&gt;NOTE: Variable price is uninitialized.&lt;BR /&gt;WARNING: Variable price already exists on file WORK.SPX2.&lt;BR /&gt;NOTE: There were 30000 observations read from the data set WORK.SPX.&lt;BR /&gt;NOTE: The data set WORK.SPX2 has 30000 observations and 12 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could not do anything on variable formats. Moreover, I could not understand why a variable is both "uninitialized" and "already exists". This is driving me crazy. What should I do ? Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2017 01:57:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOTE-Variable-X-is-uninitialize-WARNING-Variable-X-already/m-p/392894#M94594</guid>
      <dc:creator>xyxu</dc:creator>
      <dc:date>2017-09-04T01:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: NOTE: Variable X is uninitialize. WARNING: Variable X already exists on file WORK.mydataset.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOTE-Variable-X-is-uninitialize-WARNING-Variable-X-already/m-p/392897#M94596</link>
      <description>&lt;P&gt;You should do all your character to numeric conversions with input() :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydataset2;
set mydataset;
price = input(B, best.) ;
volume = input(C, best.) ;
date = input(A, anydtdte.) ;
format date yymmdd10. ;
drop A B C;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Sep 2017 02:35:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOTE-Variable-X-is-uninitialize-WARNING-Variable-X-already/m-p/392897#M94596</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-09-04T02:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: NOTE: Variable X is uninitialize. WARNING: Variable X already exists on file WORK.mydataset.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOTE-Variable-X-is-uninitialize-WARNING-Variable-X-already/m-p/392899#M94597</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Rename statement and Rename option works little differently.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Rename statement would apply new name in the output dataset and not while processing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I suggest either use any of the below two option&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Option 1: Use data step option&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; data mydataset2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; set mydataset (&amp;nbsp; &amp;nbsp; rename=( A=date B=price C=volume));&lt;BR /&gt;&amp;nbsp; &amp;nbsp; price2=input(price,12.);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Option 2:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; data mydataset2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; set mydataset;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; rename A=date B=price C=volume;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; price2=input(B,12.);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2017 02:43:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOTE-Variable-X-is-uninitialize-WARNING-Variable-X-already/m-p/392899#M94597</guid>
      <dc:creator>RahulG</dc:creator>
      <dc:date>2017-09-04T02:43:55Z</dc:date>
    </item>
  </channel>
</rss>

