<?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: Variable X is uninitialized. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486452#M126573</link>
    <description>&lt;P&gt;Did you try this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data Work.lasvegas;&lt;/P&gt;
&lt;P&gt;set&amp;nbsp; &lt;SPAN&gt;Work.lasvegas;&lt;/SPAN&gt;&amp;nbsp;/*this should have your variable score*/&lt;/P&gt;
&lt;P&gt;if Score &amp;gt; 4.1230159 Then high_score = '1';&lt;/P&gt;
&lt;P&gt;Else high_score = '0';&lt;/P&gt;
&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If yes, what's the log report plz&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Aug 2018 19:35:26 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-08-13T19:35:26Z</dc:date>
    <item>
      <title>Variable X is uninitialized.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486437#M126566</link>
      <description>&lt;P&gt;data Work.lasvegas;&lt;/P&gt;&lt;P&gt;if Score &amp;gt; 4.1230159 Then high_score = '1';&lt;/P&gt;&lt;P&gt;Else high_score = '0';&lt;/P&gt;&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I put this code in and every Time the message is this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Variable Score is uninitialized.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help into why my variable is like this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Aug 2018 19:07:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486437#M126566</guid>
      <dc:creator>Goffy123</dc:creator>
      <dc:date>2018-08-13T19:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Variable X is uninitialized.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486438#M126567</link>
      <description>&lt;P&gt;are you missing the set statement that reads the input dataset records?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am assuming your score variable is the input dataset&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code should likely be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data Work.lasvegas;&lt;/P&gt;
&lt;P&gt;set your_inputdataset; /*this should have your variable score*/&lt;/P&gt;
&lt;P&gt;if Score &amp;gt; 4.1230159 Then high_score = '1';&lt;/P&gt;
&lt;P&gt;Else high_score = '0';&lt;/P&gt;
&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Aug 2018 19:11:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486438#M126567</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-08-13T19:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Variable X is uninitialized.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486439#M126568</link>
      <description>&lt;P&gt;Your code does not show anything where you are using existing data, such as a set statement.&lt;/P&gt;
&lt;P&gt;So since you have not assigned any value to the variable SCORE it is "unitialized".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you meant to refence and existing data set that has the variable score then you should have a set statement referencing that data set before attempting to use the variable.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Aug 2018 19:11:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486439#M126568</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-13T19:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Variable X is uninitialized.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486450#M126571</link>
      <description>my data set is Work.lasvegas and SCORE is a variable within that. Using this SET step is not working. Any other help?&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Aug 2018 19:32:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486450#M126571</guid>
      <dc:creator>Goffy123</dc:creator>
      <dc:date>2018-08-13T19:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Variable X is uninitialized.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486451#M126572</link>
      <description>My dataset is work.lasvegas and my score is a variable within that. This set step is not working any other help?</description>
      <pubDate>Mon, 13 Aug 2018 19:33:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486451#M126572</guid>
      <dc:creator>Goffy123</dc:creator>
      <dc:date>2018-08-13T19:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: Variable X is uninitialized.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486452#M126573</link>
      <description>&lt;P&gt;Did you try this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data Work.lasvegas;&lt;/P&gt;
&lt;P&gt;set&amp;nbsp; &lt;SPAN&gt;Work.lasvegas;&lt;/SPAN&gt;&amp;nbsp;/*this should have your variable score*/&lt;/P&gt;
&lt;P&gt;if Score &amp;gt; 4.1230159 Then high_score = '1';&lt;/P&gt;
&lt;P&gt;Else high_score = '0';&lt;/P&gt;
&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If yes, what's the log report plz&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Aug 2018 19:35:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486452#M126573</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-08-13T19:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: Variable X is uninitialized.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486454#M126575</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/226110"&gt;@Goffy123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;My dataset is work.lasvegas and my score is a variable within that. This set step is not working any other help?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data Work.lasvegas;
&lt;STRONG&gt;&lt;FONT color="#ff0000" size="4"&gt;set Work.lasvegas;&lt;/FONT&gt;&lt;/STRONG&gt;
if Score &amp;gt; 4.1230159 Then high_score = '1';

Else high_score = '0';

run; 
&lt;/PRE&gt;
&lt;P&gt;SET is an instruction that tells SAS to read data from a data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW habitual use of the&lt;/P&gt;
&lt;P&gt;Data somesetname;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set somesetname;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;will cause you problems at some point when you make a minor coding issue as that coding structure completely replaces the data set and may make it extremely difficult to determine why something is not working.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Aug 2018 19:37:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486454#M126575</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-13T19:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Variable X is uninitialized.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486456#M126577</link>
      <description>&lt;P&gt;Because you have run this program, you have destroyed your data set work.lasvegas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will need to re-create it first.&amp;nbsp; Then use it in a SET statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data new_dataset;&lt;/P&gt;
&lt;P&gt;set Work.lasvegas;&lt;/P&gt;
&lt;P&gt;if Score &amp;gt; 4.1230159 Then high_score = '1';&lt;/P&gt;
&lt;P&gt;Else high_score = '0';&lt;/P&gt;
&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Aug 2018 19:40:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486456#M126577</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-13T19:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Variable X is uninitialized.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486459#M126580</link>
      <description>Note: There were 1 observation read from data set Work.LASVEGAS.&lt;BR /&gt;Note: the data set WORK.LASVEGAS has 1 observation and 2 variables.&lt;BR /&gt;Thats what comes from that code.</description>
      <pubDate>Mon, 13 Aug 2018 19:47:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486459#M126580</guid>
      <dc:creator>Goffy123</dc:creator>
      <dc:date>2018-08-13T19:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: Variable X is uninitialized.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486460#M126581</link>
      <description>Note: there were 1 observation read from dataset WORK.Lasvegas.&lt;BR /&gt;NOte: the dataset work.lasvegas has 1 observation and 2 variables.&lt;BR /&gt;Thats the code from that code and doesn't give me the results.</description>
      <pubDate>Mon, 13 Aug 2018 19:49:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486460#M126581</guid>
      <dc:creator>Goffy123</dc:creator>
      <dc:date>2018-08-13T19:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Variable X is uninitialized.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486465#M126586</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/226110"&gt;@Goffy123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Note: there were 1 observation read from dataset WORK.Lasvegas.&lt;BR /&gt;NOte: the dataset work.lasvegas has 1 observation and 2 variables.&lt;BR /&gt;Thats the code from that code and doesn't give me the results.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Did you pay any attention that you were told the first time you ran your example code that you destroyed the data set work.lasvegas and replaced with a single record data set with two variables that were missing?&lt;/P&gt;
&lt;P&gt;Because you did not include the SET statement the first time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now you have to go back to where you got the original data to create work.lasvegas&amp;nbsp;and start over.&lt;/P&gt;
&lt;P&gt;Which is why I mentioned using that structure of code even with the SET statement can cause problems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Aug 2018 20:03:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486465#M126586</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-13T20:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: Variable X is uninitialized.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486472#M126590</link>
      <description>Thank you so much you don't know how long I have been stuck on that aha</description>
      <pubDate>Mon, 13 Aug 2018 20:18:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-X-is-uninitialized/m-p/486472#M126590</guid>
      <dc:creator>Goffy123</dc:creator>
      <dc:date>2018-08-13T20:18:00Z</dc:date>
    </item>
  </channel>
</rss>

