<?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: Assigning X variable = 1 for each observation in dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Assigning-X-variable-1-for-each-observation-in-dataset/m-p/269842#M53503</link>
    <description>&lt;P&gt;A few comments ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, what you are claiming is not possible.&amp;nbsp; That code would always work.&amp;nbsp; It is possible that you have additional code BEFORE what you showed us that is causing a problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, many people can help you debug this.&amp;nbsp; But you have to show the log, including the error message.&amp;nbsp; That would be much more helpful than the program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, why are you doing this?&amp;nbsp; At least 99% of the time, creating such a variable is not useful.&amp;nbsp; If you can describe what you would like to accomplish, it is likely that there is an easier way that does not involve creation of a new variable.&lt;/P&gt;</description>
    <pubDate>Wed, 11 May 2016 18:43:00 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-05-11T18:43:00Z</dc:date>
    <item>
      <title>Assigning X variable = 1 for each observation in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-X-variable-1-for-each-observation-in-dataset/m-p/269839#M53502</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this data and x variable which I added using this code below the figure:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3124iFA626DE169BBE2E8/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="cancer.PNG" title="cancer.PNG" width="493" height="370" /&gt;&lt;/P&gt;&lt;PRE class="  language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;Data&lt;/SPAN&gt; Test&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;Set&lt;/SPAN&gt; T1&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
X &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; _n_&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;Run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What I needed actually was to add the variable X with assigning 1 to each observation.&lt;/P&gt;&lt;P&gt;so I changed the statement to&amp;nbsp;&lt;/P&gt;&lt;PRE class="  language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;Data&lt;/SPAN&gt; Test&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;Set&lt;/SPAN&gt; T1&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
X &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;Run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And it did not work ( it says data has 0 observations).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 18:38:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-X-variable-1-for-each-observation-in-dataset/m-p/269839#M53502</guid>
      <dc:creator>mayasak</dc:creator>
      <dc:date>2016-05-11T18:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning X variable = 1 for each observation in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-X-variable-1-for-each-observation-in-dataset/m-p/269842#M53503</link>
      <description>&lt;P&gt;A few comments ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, what you are claiming is not possible.&amp;nbsp; That code would always work.&amp;nbsp; It is possible that you have additional code BEFORE what you showed us that is causing a problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, many people can help you debug this.&amp;nbsp; But you have to show the log, including the error message.&amp;nbsp; That would be much more helpful than the program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, why are you doing this?&amp;nbsp; At least 99% of the time, creating such a variable is not useful.&amp;nbsp; If you can describe what you would like to accomplish, it is likely that there is an easier way that does not involve creation of a new variable.&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 18:43:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-X-variable-1-for-each-observation-in-dataset/m-p/269842#M53503</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-05-11T18:43:00Z</dc:date>
    </item>
  </channel>
</rss>

