<?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 why wouldn't it work out in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/why-wouldn-t-it-work-out/m-p/17836#M2610</link>
    <description>When I am trying to run the following code, it can not stop at all. Could some one figure it out for me? Thanks&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
libname project 'G:\Courseinfo\fall2009\CS699\presentation';&lt;BR /&gt;
options validvarname=any mprint mlogic mautosource symbolgen;&lt;BR /&gt;
&lt;BR /&gt;
	%macro test(original_data);&lt;BR /&gt;
	%let attrib_list_T0=D2_class DFA_class HNR_class Jitter_DDP_class MDVP_APQ_class MDVP_Fhi_class MDVP_Flo_class MDVP_Fo_class MDVP_Jitter_class MDVP_PPQ_class MDVP_RAP_class&lt;BR /&gt;
MDVP_Shimmer_class NHR_class PPE_class RPDE_class Shimmer_APQ3_class Shimmer_APQ5_class Shimmer_DDA_class spread1_class spread2_class;&lt;BR /&gt;
&lt;BR /&gt;
%let y=1;&lt;BR /&gt;
%let attrib_item=D2_class;&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
%do %while (&amp;amp;attrib_item ne ); *****acquiring value counts and value list of each attribute from table T0******;&lt;BR /&gt;
&lt;BR /&gt;
   select count(distinct trim(&amp;amp;attrib_item)) into :T0_&amp;amp;attrib_item._value_count&lt;BR /&gt;
   from project.&amp;amp;original_data;&lt;BR /&gt;
   select distinct trim(&amp;amp;attrib_item) into :T0_&amp;amp;attrib_item._values separated by '*'&lt;BR /&gt;
   from project.&amp;amp;original_data;&lt;BR /&gt;
&lt;BR /&gt;
%let attrib_item=%scan(&amp;amp;attrib_list_T0, %eval(&amp;amp;y+1), %str( ));&lt;BR /&gt;
&lt;BR /&gt;
%end;&lt;BR /&gt;
quit;&lt;BR /&gt;
%mend;&lt;BR /&gt;
&lt;BR /&gt;
%test(merged_pd_data)</description>
    <pubDate>Tue, 17 Nov 2009 01:02:22 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-11-17T01:02:22Z</dc:date>
    <item>
      <title>why wouldn't it work out</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-wouldn-t-it-work-out/m-p/17836#M2610</link>
      <description>When I am trying to run the following code, it can not stop at all. Could some one figure it out for me? Thanks&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
libname project 'G:\Courseinfo\fall2009\CS699\presentation';&lt;BR /&gt;
options validvarname=any mprint mlogic mautosource symbolgen;&lt;BR /&gt;
&lt;BR /&gt;
	%macro test(original_data);&lt;BR /&gt;
	%let attrib_list_T0=D2_class DFA_class HNR_class Jitter_DDP_class MDVP_APQ_class MDVP_Fhi_class MDVP_Flo_class MDVP_Fo_class MDVP_Jitter_class MDVP_PPQ_class MDVP_RAP_class&lt;BR /&gt;
MDVP_Shimmer_class NHR_class PPE_class RPDE_class Shimmer_APQ3_class Shimmer_APQ5_class Shimmer_DDA_class spread1_class spread2_class;&lt;BR /&gt;
&lt;BR /&gt;
%let y=1;&lt;BR /&gt;
%let attrib_item=D2_class;&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
%do %while (&amp;amp;attrib_item ne ); *****acquiring value counts and value list of each attribute from table T0******;&lt;BR /&gt;
&lt;BR /&gt;
   select count(distinct trim(&amp;amp;attrib_item)) into :T0_&amp;amp;attrib_item._value_count&lt;BR /&gt;
   from project.&amp;amp;original_data;&lt;BR /&gt;
   select distinct trim(&amp;amp;attrib_item) into :T0_&amp;amp;attrib_item._values separated by '*'&lt;BR /&gt;
   from project.&amp;amp;original_data;&lt;BR /&gt;
&lt;BR /&gt;
%let attrib_item=%scan(&amp;amp;attrib_list_T0, %eval(&amp;amp;y+1), %str( ));&lt;BR /&gt;
&lt;BR /&gt;
%end;&lt;BR /&gt;
quit;&lt;BR /&gt;
%mend;&lt;BR /&gt;
&lt;BR /&gt;
%test(merged_pd_data)</description>
      <pubDate>Tue, 17 Nov 2009 01:02:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-wouldn-t-it-work-out/m-p/17836#M2610</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-11-17T01:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: why wouldn't it work out</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-wouldn-t-it-work-out/m-p/17837#M2611</link>
      <description>You cannot combine macro language (specifically your use of macro variables) with the PROC SQL code that is supposed to generate the macro variable values.&lt;BR /&gt;
&lt;BR /&gt;
If you were to add:&lt;BR /&gt;
&lt;BR /&gt;
OPTIONS SOURCE SOURCE2 MACROGEN SYMBOLGEN MLOGIC;&lt;BR /&gt;
&lt;BR /&gt;
you would see the looping condition.&lt;BR /&gt;
&lt;BR /&gt;
You need to separately generate the macro variable(s) containing your criteria upfront and then use the %DO / %END to loop through the pre-defined variable list.&lt;BR /&gt;
&lt;BR /&gt;
Search the SAS support &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website for using macro language to generate code.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 17 Nov 2009 01:30:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-wouldn-t-it-work-out/m-p/17837#M2611</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-11-17T01:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: why wouldn't it work out</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-wouldn-t-it-work-out/m-p/17838#M2612</link>
      <description>I don't see where &amp;amp;y is increasing.&lt;BR /&gt;
And besides do not use &lt;I&gt;&amp;amp;attrib_item ne &lt;/I&gt;&lt;BR /&gt;
&lt;BR /&gt;
Instead use &lt;I&gt;"&amp;amp;attrib_item" ne ""&lt;/I&gt;</description>
      <pubDate>Tue, 17 Nov 2009 13:11:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-wouldn-t-it-work-out/m-p/17838#M2612</guid>
      <dc:creator>SAS_user</dc:creator>
      <dc:date>2009-11-17T13:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: why wouldn't it work out</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-wouldn-t-it-work-out/m-p/17839#M2613</link>
      <description>&amp;gt; You cannot combine macro language (specifically your&lt;BR /&gt;
&amp;gt; use of macro variables) with the PROC SQL code that&lt;BR /&gt;
&amp;gt; is supposed to generate the macro variable values.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Why not? Everything seems to be ok. &lt;BR /&gt;
Macro generates code. Code generates macroVars.</description>
      <pubDate>Tue, 17 Nov 2009 13:14:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-wouldn-t-it-work-out/m-p/17839#M2613</guid>
      <dc:creator>SAS_user</dc:creator>
      <dc:date>2009-11-17T13:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: why wouldn't it work out</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-wouldn-t-it-work-out/m-p/17840#M2614</link>
      <description>My mistake - you are correct and the code should work, but the problem, as mentioned in another forum reply is that your &amp;amp;Y variable never gets incremented in a %LET assignment statement.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 17 Nov 2009 14:01:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-wouldn-t-it-work-out/m-p/17840#M2614</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-11-17T14:01:44Z</dc:date>
    </item>
  </channel>
</rss>

