<?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: call define in proc report in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898197#M355003</link>
    <description>&lt;P&gt;I am not seeing a description of what you want to actually accomplish.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Generally Proc Report builds things from left to right. So values of weight, which appear to the RIGHT of Height in your table are already "past" building values for height.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps:&lt;/P&gt;
&lt;PRE&gt;proc report data=sashelp.class;
    
   column age name sex weight Height ;
	define name / order;
	define age / order;
	define sex / display;
	define Height /analysis sum;
	define weight / display;
	compute height;
	  if weight &amp;gt;95 and height.sum&amp;gt;63 then do;
		call define('Height.sum','style','style={background=lightgreen}');
		
	  end;
	endcomp;
run;&lt;/PRE&gt;</description>
    <pubDate>Wed, 11 Oct 2023 18:19:24 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2023-10-11T18:19:24Z</dc:date>
    <item>
      <title>call define in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898189#M354999</link>
      <description>&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;I have a problem with my proc report in the call define part.I'm not going to use my real data, I'm trying to use the class table instead. I want to make two conditions on my call define,If I only use the first condition: if weight = 77 I have no problem. but if I add the second condition I have nothing in the result. I think I have a problem with my code.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;Thank's&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=sashelp.class;
    
    column age name sex height weight;
	define name / order;
	define age / order;
	define sex / display;
	define height /analysis;
	define weight / display;
	compute weight;
	  if weight &amp;gt;95 and height&amp;gt;63 then do;
	    
		call define('height.sum','style','style={background=lightgreen}');
		
	  end;
	endcomp;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 17:49:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898189#M354999</guid>
      <dc:creator>snip</dc:creator>
      <dc:date>2023-10-11T17:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: call define in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898190#M355000</link>
      <description>&lt;P&gt;I haven't used it in this way, but this gives you the green boxes for SASHELP.CLASS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=sashelp.class;
    
    column age name sex height weight;
	define name / order;
	define age / order;
	define sex / display;
	define height / display;
	define weight / display;
	compute weight;
	  if weight &amp;gt;95 and height&amp;gt;63 then do;
	    
		call define('height','style','style={background=lightgreen}');
		
	  end;
	endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Changed height from analysis to display, and removed the .sum in the call define.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maguiremq_0-1697047111301.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/88786i16E1DCB45C9C626F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="maguiremq_0-1697047111301.png" alt="maguiremq_0-1697047111301.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again, not sure if that's what you need.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 17:58:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898190#M355000</guid>
      <dc:creator>maguiremq</dc:creator>
      <dc:date>2023-10-11T17:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: call define in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898193#M355001</link>
      <description>&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;did you read my message? &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;I have to keep define height in analysis and define weight in display&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;and that's not what you used&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 18:05:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898193#M355001</guid>
      <dc:creator>snip</dc:creator>
      <dc:date>2023-10-11T18:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: call define in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898194#M355002</link>
      <description>Ah, my apologies.</description>
      <pubDate>Wed, 11 Oct 2023 18:06:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898194#M355002</guid>
      <dc:creator>maguiremq</dc:creator>
      <dc:date>2023-10-11T18:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: call define in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898197#M355003</link>
      <description>&lt;P&gt;I am not seeing a description of what you want to actually accomplish.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Generally Proc Report builds things from left to right. So values of weight, which appear to the RIGHT of Height in your table are already "past" building values for height.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps:&lt;/P&gt;
&lt;PRE&gt;proc report data=sashelp.class;
    
   column age name sex weight Height ;
	define name / order;
	define age / order;
	define sex / display;
	define Height /analysis sum;
	define weight / display;
	compute height;
	  if weight &amp;gt;95 and height.sum&amp;gt;63 then do;
		call define('Height.sum','style','style={background=lightgreen}');
		
	  end;
	endcomp;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Oct 2023 18:19:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898197#M355003</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-10-11T18:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: call define in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898198#M355004</link>
      <description>&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;I think I'm misdeclaring the call define...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;could someone help me please?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 18:19:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898198#M355004</guid>
      <dc:creator>snip</dc:creator>
      <dc:date>2023-10-11T18:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: call define in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898201#M355006</link>
      <description>&lt;P&gt;Why do you feel that HEIGHT should be an analysis variable? For this example, there is no benefit to make HEIGHT an analysis variable.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 18:38:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898201#M355006</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-10-11T18:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: call define in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898207#M355010</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OP is using SASHELP.Class as a surrogate for his actual data and&amp;nbsp; just needed &lt;U&gt;something&lt;/U&gt; to sum.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 19:17:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898207#M355010</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-10-11T19:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: call define in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898208#M355011</link>
      <description>&lt;P&gt;That may be the case, but then the responsibility is on the OP to find an example data set that illustrates the problem, and not show us a data set that is different in important ways and does not illustrate the problem.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 19:20:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898208#M355011</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-10-11T19:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: call define in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898219#M355014</link>
      <description>&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;I used the class table only to give an example and show you my problem.I made sure to reproduce my problem on the class table, I know that there is no sense in applying it to this table but I do not have the possibility of sharing my real data. &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; was able to answer me, your code syntax suits me very well and that's what I was looking for.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt; THANKS&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 20:31:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-define-in-proc-report/m-p/898219#M355014</guid>
      <dc:creator>snip</dc:creator>
      <dc:date>2023-10-11T20:31:32Z</dc:date>
    </item>
  </channel>
</rss>

