<?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: Creating Variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-Variables/m-p/533564#M146301</link>
    <description>&lt;P&gt;one way&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
retain var1-var10 0;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 07 Feb 2019 12:22:46 GMT</pubDate>
    <dc:creator>kiranv_</dc:creator>
    <dc:date>2019-02-07T12:22:46Z</dc:date>
    <item>
      <title>Creating Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Variables/m-p/533557#M146298</link>
      <description>&lt;P&gt;I need shortest way for creating Var0-Var10 with 0 value.&lt;/P&gt;&lt;P&gt;Sample:&lt;/P&gt;&lt;P&gt;VAR0 VAR1 VAR2 ...&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 12:14:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Variables/m-p/533557#M146298</guid>
      <dc:creator>Vahe_Mar</dc:creator>
      <dc:date>2019-02-07T12:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Variables/m-p/533561#M146299</link>
      <description>&lt;PRE&gt;data want;
  array var{10} 8 (0,0,0,0,0,0,0,0,0,0);
run;&lt;/PRE&gt;
&lt;P&gt;That would create var1-var10.&amp;nbsp; There doesn't seem to be a simple method of it:&lt;/P&gt;
&lt;PRE&gt;data want;
  retain var0 var1 var2 var3 var4 var5 var6 var7 var8 var9 var10 0;
run;&lt;/PRE&gt;
&lt;PRE&gt;data want;
  array x var0-var10;
  do over x;
    x=0;
  end;
run;&lt;/PRE&gt;
&lt;P&gt;I mean you could do:&lt;/P&gt;
&lt;PRE&gt;options missing=0;
data want;
  length var0-var10 8;
run;&lt;/PRE&gt;
&lt;P&gt;But that is not actually setting the value, just changing the system default.&lt;/P&gt;
&lt;P&gt;I suppose the real question is why you would need to, are you performing some calculation and want a template to add to or sum with?&amp;nbsp; There is likely to be better methods, but need more information.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 12:20:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Variables/m-p/533561#M146299</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-07T12:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Variables/m-p/533563#M146300</link>
      <description>RW9 Thanks for answering. Yes i am calculating something and final data should have 10 variables. Some of calculation have two some of 3 , i need set it together and if have missing values in calculation I will have 0 instead of missing.</description>
      <pubDate>Thu, 07 Feb 2019 12:21:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Variables/m-p/533563#M146300</guid>
      <dc:creator>Vahe_Mar</dc:creator>
      <dc:date>2019-02-07T12:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Variables/m-p/533564#M146301</link>
      <description>&lt;P&gt;one way&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
retain var1-var10 0;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Feb 2019 12:22:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Variables/m-p/533564#M146301</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2019-02-07T12:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Variables/m-p/533568#M146304</link>
      <description>&lt;P&gt;if you have dataset then probably do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
array h(*) var0-var10;
do i = 1 to dim(h);
if h(i)= . then 
h(i) = 0;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Feb 2019 12:36:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Variables/m-p/533568#M146304</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2019-02-07T12:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Variables/m-p/533571#M146305</link>
      <description>Thanks used this way</description>
      <pubDate>Thu, 07 Feb 2019 12:48:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Variables/m-p/533571#M146305</guid>
      <dc:creator>Vahe_Mar</dc:creator>
      <dc:date>2019-02-07T12:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Variables/m-p/533574#M146306</link>
      <description>&lt;P&gt;If your counting something then you shouldn't need to create variables?&amp;nbsp; If the data doesn't have something that you are expecting, either add a template, or pad out the data you already have.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 13:13:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Variables/m-p/533574#M146306</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-07T13:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Variables/m-p/533588#M146313</link>
      <description>&lt;P&gt;Is your question just to create an(one) observation?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or is there a bigger objective?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 14:20:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Variables/m-p/533588#M146313</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-02-07T14:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Variables/m-p/533905#M146435</link>
      <description>Dear novinosrin ,&lt;BR /&gt;just create one obs its part of coding with other part I am good thanks for asking</description>
      <pubDate>Fri, 08 Feb 2019 13:24:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Variables/m-p/533905#M146435</guid>
      <dc:creator>Vahe_Mar</dc:creator>
      <dc:date>2019-02-08T13:24:12Z</dc:date>
    </item>
  </channel>
</rss>

