<?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: Using numerous variables in STD function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-numerous-variables-in-STD-function/m-p/606808#M176274</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/300764"&gt;@skjhzzang&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use an array to do that. You can then refer to the array name e.g. myarray(*) in a function like below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data STD std2;
	input Name : $5. Var1 Var2 Var3;
	array myarray (*) Var1 - Var3; /* Reference you variables once */

	do i=1 to dim(myarray);
		Mean=Mean(of myarray(*));
		std=round(std(of myarray(*)), 0.01);
	end;
	drop i;
	
	output std;

	if std&amp;lt;=150 then
		output std2;
	datalines;
MATT 145 349 48
Susan 194 578 300
Tom 394 84 291
Jayce 394 58 279
;
run;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 24 Nov 2019 11:36:19 GMT</pubDate>
    <dc:creator>ed_sas_member</dc:creator>
    <dc:date>2019-11-24T11:36:19Z</dc:date>
    <item>
      <title>Using numerous variables in STD function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-numerous-variables-in-STD-function/m-p/606806#M176273</link>
      <description>&lt;P&gt;Basically, to use Standard deviation function (STD), I know that I can use it as STD = STD(Var1, Var2, Var3);&lt;/P&gt;&lt;P&gt;but how about if I have 100 numerical variables?&lt;/P&gt;&lt;P&gt;In input statement, I know that it is possible to use like this, input Var1 - Var100;&lt;/P&gt;&lt;P&gt;Then, for STD function, do I have to write all 100 variables into parenthesis?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Nov 2019 11:18:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-numerous-variables-in-STD-function/m-p/606806#M176273</guid>
      <dc:creator>skjhzzang</dc:creator>
      <dc:date>2019-11-24T11:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using numerous variables in STD function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-numerous-variables-in-STD-function/m-p/606808#M176274</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/300764"&gt;@skjhzzang&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use an array to do that. You can then refer to the array name e.g. myarray(*) in a function like below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data STD std2;
	input Name : $5. Var1 Var2 Var3;
	array myarray (*) Var1 - Var3; /* Reference you variables once */

	do i=1 to dim(myarray);
		Mean=Mean(of myarray(*));
		std=round(std(of myarray(*)), 0.01);
	end;
	drop i;
	
	output std;

	if std&amp;lt;=150 then
		output std2;
	datalines;
MATT 145 349 48
Susan 194 578 300
Tom 394 84 291
Jayce 394 58 279
;
run;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Nov 2019 11:36:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-numerous-variables-in-STD-function/m-p/606808#M176274</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-11-24T11:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using numerous variables in STD function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-numerous-variables-in-STD-function/m-p/606811#M176276</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;stdev=std(of var1-var100);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 24 Nov 2019 12:17:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-numerous-variables-in-STD-function/m-p/606811#M176276</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-11-24T12:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using numerous variables in STD function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-numerous-variables-in-STD-function/m-p/606812#M176277</link>
      <description>&lt;P&gt;If they all have the same prefix, you do not even need the array:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;result = std(of var:);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 24 Nov 2019 12:24:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-numerous-variables-in-STD-function/m-p/606812#M176277</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-24T12:24:20Z</dc:date>
    </item>
  </channel>
</rss>

