<?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: performing function on 11k variables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/performing-function-on-11k-variables/m-p/54762#M15191</link>
    <description>You can drive this process using an ARRAY in a single DATA step pass of each file.   The ARRAY can be declared so that only _NUMERIC_ variables are included, presuming you are not attempting to parse CHARACTER type variables that contain numbers, otherwise the array can be declared with _ALL_  to process all CHARACTER and NUMERIC type variables.&lt;BR /&gt;
&lt;BR /&gt;
Also, when you detect a variable that has the required data-string content (beyond 1 decimal place), you could identify the array subscript as a "keeper", maybe using CALL SYMPUT, once you have detected at least one observation that has the variable content.&lt;BR /&gt;
&lt;BR /&gt;
These are but a few points relative to how you might want to consider optimizing the processing to reach your objective.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Wed, 15 Jul 2009 16:12:43 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2009-07-15T16:12:43Z</dc:date>
    <item>
      <title>performing function on 11k variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/performing-function-on-11k-variables/m-p/54761#M15190</link>
      <description>the goal of the below program is to count the numeric values pass the decimal point.&lt;BR /&gt;
if the selected variable has numbers after the decimal the name is recorded.  overall i want a file with the applicable variables names.&lt;BR /&gt;
&lt;BR /&gt;
the problem is that i am trying to resolve is to perform this operator for 11k variables.  i have tried to load the vars in a macro but they exceed the max length.  i have also tried some proc sql steps but admit that i dont use sql.  any suggestions?&lt;BR /&gt;
&lt;BR /&gt;
%let var=weight; &lt;BR /&gt;
data mac;&lt;BR /&gt;
	set desk.opa(keep=&amp;amp;var) end=eof;&lt;BR /&gt;
&lt;BR /&gt;
	length name $ 25;&lt;BR /&gt;
	hasFlag = (length(trim(left(scan(&amp;amp;var , 2 , '.' ))))) &amp;gt; 2 ;&lt;BR /&gt;
	if hasFlag &amp;gt;0 then count+ 1;&lt;BR /&gt;
	if count gt 0 then NAME="&amp;amp;var";&lt;BR /&gt;
	if eof then output;&lt;BR /&gt;
&lt;BR /&gt;
run;&lt;BR /&gt;
this works as desired but for only this var.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
tried&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint ;&lt;BR /&gt;
&lt;BR /&gt;
  create table vars as&lt;BR /&gt;
  select name&lt;BR /&gt;
  from dictionary.columns&lt;BR /&gt;
  where memname = 'OPA'&lt;BR /&gt;
  order by name  ;&lt;BR /&gt;
&lt;BR /&gt;
  select distinct name&lt;BR /&gt;
  into :origvars separated by ' '&lt;BR /&gt;
  from vars&lt;BR /&gt;
  order by name  ;&lt;BR /&gt;
&lt;BR /&gt;
quit ;&lt;BR /&gt;
&lt;BR /&gt;
%let var=&amp;amp;origvars; &lt;BR /&gt;
data mac;&lt;BR /&gt;
	set desk.opa(keep=&amp;amp;var) end=eof;&lt;BR /&gt;
&lt;BR /&gt;
	length name $ 25;&lt;BR /&gt;
	hasFlag = (length(trim(left(scan(&amp;amp;var , 2 , '.' ))))) &amp;gt; 2 ;&lt;BR /&gt;
	if hasFlag &amp;gt;0 then count+ 1;&lt;BR /&gt;
	if count gt 0 then NAME="&amp;amp;var";&lt;BR /&gt;
	if eof then output;&lt;BR /&gt;
&lt;BR /&gt;
run;&lt;BR /&gt;
this is where i get "exceeds max length error" and the "expecting a arithmetic operator", separating the string of variables.  this was not resolved but changing the into :origvars separated by ' ' to into :origvars separated by ','</description>
      <pubDate>Wed, 15 Jul 2009 14:48:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/performing-function-on-11k-variables/m-p/54761#M15190</guid>
      <dc:creator>Hart</dc:creator>
      <dc:date>2009-07-15T14:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: performing function on 11k variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/performing-function-on-11k-variables/m-p/54762#M15191</link>
      <description>You can drive this process using an ARRAY in a single DATA step pass of each file.   The ARRAY can be declared so that only _NUMERIC_ variables are included, presuming you are not attempting to parse CHARACTER type variables that contain numbers, otherwise the array can be declared with _ALL_  to process all CHARACTER and NUMERIC type variables.&lt;BR /&gt;
&lt;BR /&gt;
Also, when you detect a variable that has the required data-string content (beyond 1 decimal place), you could identify the array subscript as a "keeper", maybe using CALL SYMPUT, once you have detected at least one observation that has the variable content.&lt;BR /&gt;
&lt;BR /&gt;
These are but a few points relative to how you might want to consider optimizing the processing to reach your objective.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 15 Jul 2009 16:12:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/performing-function-on-11k-variables/m-p/54762#M15191</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-07-15T16:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: performing function on 11k variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/performing-function-on-11k-variables/m-p/54763#M15192</link>
      <description>Thanks for the reply Scott,&lt;BR /&gt;
&lt;BR /&gt;
I actually did try one of your suggestions- _NUMERIC_ as in:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
  set desk.Opa;&lt;BR /&gt;
  array allvar ( * ) &amp;amp;origvars _NUMERIC_;&lt;BR /&gt;
  do i = 1 to dim ( allvar ) ;&lt;BR /&gt;
	 hasFlag = (length(trim(left(scan(allvar(i) , 2 , '.' ))))) &amp;gt; 2 ;&lt;BR /&gt;
	if hasFlag &amp;gt;0 then count+ 1;&lt;BR /&gt;
	if count &amp;gt; 0 then NAME="&amp;amp;origvars";&lt;BR /&gt;
  end ;&lt;BR /&gt;
 run ;&lt;BR /&gt;
&lt;BR /&gt;
unfortnately my data exceeds the max length.  i will research the CALL SYMPUT though. &lt;BR /&gt;
&lt;BR /&gt;
Thanks again</description>
      <pubDate>Wed, 15 Jul 2009 16:25:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/performing-function-on-11k-variables/m-p/54763#M15192</guid>
      <dc:creator>Hart</dc:creator>
      <dc:date>2009-07-15T16:25:38Z</dc:date>
    </item>
  </channel>
</rss>

