<?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: Questions on proc means and more in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Questions-on-proc-means-and-more/m-p/747214#M38917</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;You're welcome Obsidian.&amp;nbsp;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/366654"&gt;@Dee2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks Jade.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. What is the variable name for&amp;nbsp;day1 - day&amp;amp;post_days.? what does it do here?&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#00CCFF"&gt;This is a "SAS Variable List" if POST_DAYS is 7 then DAY1-DAY7&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#00ccff"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#800080"&gt;&lt;FONT color="#00ccff"&gt;Day1 minus Day7? &lt;FONT color="#339966"&gt;For a "SAS Variable List" the - (minus sign) indicates a list of&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#339966"&gt;enumerated variables DAY1 DAY2 DAY3 ... DAY7&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#00CCFF"&gt;&lt;FONT color="#800080"&gt;&lt;SPAN&gt;&lt;FONT color="#000000"&gt;a. (d_member_id ne .) means d_member_id not = blank? The&amp;nbsp;d_member_id shouldn't have blank.&lt;/FONT&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#00CCFF"&gt;Filter the output data.&amp;nbsp; Without MISSING options there should be not missing class levels.&amp;nbsp; &lt;FONT color="#800080"&gt;Filter&amp;nbsp;&lt;SPAN&gt;d_member_id not = blank? (ne .)?&amp;nbsp;&amp;nbsp;&lt;FONT color="#339966"&gt;also NOT missing(d_member_id)&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&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, 10 Jun 2021 20:34:26 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2021-06-10T20:34:26Z</dc:date>
    <item>
      <title>Questions on proc means and more</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Questions-on-proc-means-and-more/m-p/747199#M38914</link>
      <description>&lt;P&gt;I have few questions for the code below and would like to get some help. My understanding is it did some thing on&amp;nbsp;&amp;amp;dsnn._2 and output to&amp;nbsp;&amp;amp;dsnn._3 but I don't understand&lt;/P&gt;
&lt;P&gt;1. The&amp;nbsp;d_member_id, date1, and indexdt are columns. What does class do and get here?&lt;/P&gt;
&lt;P&gt;2. What is the variable name for&amp;nbsp;day1 - day&amp;amp;post_days.? what does it do here?&lt;/P&gt;
&lt;P&gt;3. This code "(where=(d_member_id ne .) drop=_:) max=;"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; a. (d_member_id ne .) means d_member_id not = blank? The&amp;nbsp;d_member_id shouldn't have blank.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; b. drop what?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; c. max what? if max a column, what is the group by?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc means data=&amp;amp;dsnn._2 noprint nway;&lt;BR /&gt;class d_member_id date1 indexdt;&lt;BR /&gt;var day1 - day&amp;amp;post_days.;&lt;BR /&gt;output out=&amp;amp;dsnn._3(where=(d_member_id ne .) drop=_:) max=;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 19:37:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Questions-on-proc-means-and-more/m-p/747199#M38914</guid>
      <dc:creator>Dee2</dc:creator>
      <dc:date>2021-06-10T19:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Questions on proc means and more</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Questions-on-proc-means-and-more/m-p/747200#M38915</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/366654"&gt;@Dee2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have few questions for the code below and would like to get some help. My understanding is it did some thing on&amp;nbsp;&amp;amp;dsnn._2 and output to&amp;nbsp;&amp;amp;dsnn._3 but I don't understand&lt;/P&gt;
&lt;P&gt;1. The&amp;nbsp;d_member_id, date1, and indexdt are columns. What does class do and get here?&amp;nbsp;&lt;FONT color="#00CCFF"&gt;Class defines the groups for the summary.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;2. What is the variable name for&amp;nbsp;day1 - day&amp;amp;post_days.? what does it do here?&amp;nbsp;&lt;FONT color="#00CCFF"&gt;This is a "SAS Variable List" if POST_DAYS is 7 then DAY1-DAY7.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;3. This code "(where=(d_member_id ne .) drop=_:) max=;"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; a. (d_member_id ne .) means d_member_id not = blank? The&amp;nbsp;d_member_id shouldn't have blank.&amp;nbsp;&lt;FONT color="#00CCFF"&gt;Filter the output data.&amp;nbsp; Without MISSING options there should be not missing class levels.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; b. drop what?&amp;nbsp;&lt;FONT color="#00CCFF"&gt;Another "SAS Variable List" drop variables that begin with "_" (i.e. _TYPE_ _FREQ_)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; c. max what? if max a column, what is the group by? &lt;FONT color="#00CCFF"&gt;MAX of all variables in VAR statement and name the MAX same as VAR&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc means data=&amp;amp;dsnn._2 noprint nway;&lt;BR /&gt;class d_member_id date1 indexdt;&lt;BR /&gt;var day1 - day&amp;amp;post_days.;&lt;BR /&gt;output out=&amp;amp;dsnn._3(where=(d_member_id ne .) drop=_:) max=;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 19:50:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Questions-on-proc-means-and-more/m-p/747200#M38915</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2021-06-10T19:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Questions on proc means and more</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Questions-on-proc-means-and-more/m-p/747209#M38916</link>
      <description>&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. What is the variable name for&amp;nbsp;day1 - day&amp;amp;post_days.? what does it do here?&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#00CCFF"&gt;This is a "SAS Variable List" if POST_DAYS is 7 then DAY1-DAY7&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#00CCFF"&gt;&amp;nbsp;&lt;FONT color="#800080"&gt;Day1 minus Day7?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#00CCFF"&gt;&lt;FONT color="#800080"&gt;&lt;SPAN&gt;&lt;FONT color="#000000"&gt;a. (d_member_id ne .) means d_member_id not = blank? The&amp;nbsp;d_member_id shouldn't have blank.&lt;/FONT&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#00CCFF"&gt;Filter the output data.&amp;nbsp; Without MISSING options there should be not missing class levels.&amp;nbsp; &lt;FONT color="#800080"&gt;Filter&amp;nbsp;&lt;SPAN&gt;d_member_id not = blank? (ne .)?&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;Thanks again.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 20:28:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Questions-on-proc-means-and-more/m-p/747209#M38916</guid>
      <dc:creator>Dee2</dc:creator>
      <dc:date>2021-06-10T20:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Questions on proc means and more</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Questions-on-proc-means-and-more/m-p/747214#M38917</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;You're welcome Obsidian.&amp;nbsp;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/366654"&gt;@Dee2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks Jade.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. What is the variable name for&amp;nbsp;day1 - day&amp;amp;post_days.? what does it do here?&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#00CCFF"&gt;This is a "SAS Variable List" if POST_DAYS is 7 then DAY1-DAY7&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#00ccff"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#800080"&gt;&lt;FONT color="#00ccff"&gt;Day1 minus Day7? &lt;FONT color="#339966"&gt;For a "SAS Variable List" the - (minus sign) indicates a list of&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#339966"&gt;enumerated variables DAY1 DAY2 DAY3 ... DAY7&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#00CCFF"&gt;&lt;FONT color="#800080"&gt;&lt;SPAN&gt;&lt;FONT color="#000000"&gt;a. (d_member_id ne .) means d_member_id not = blank? The&amp;nbsp;d_member_id shouldn't have blank.&lt;/FONT&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#00CCFF"&gt;Filter the output data.&amp;nbsp; Without MISSING options there should be not missing class levels.&amp;nbsp; &lt;FONT color="#800080"&gt;Filter&amp;nbsp;&lt;SPAN&gt;d_member_id not = blank? (ne .)?&amp;nbsp;&amp;nbsp;&lt;FONT color="#339966"&gt;also NOT missing(d_member_id)&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&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, 10 Jun 2021 20:34:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Questions-on-proc-means-and-more/m-p/747214#M38917</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2021-06-10T20:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Questions on proc means and more</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Questions-on-proc-means-and-more/m-p/747215#M38918</link>
      <description>&lt;P&gt;And addition to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__&lt;/a&gt; response for 3.C&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you request only a single statistic for a variable in an output data set created with the OUTPUT statement, such as Max= then your variable in the output data set with the name on the VAR statement holds the statistic value.&lt;/P&gt;
&lt;P&gt;If you request multiple statistics then you need to provide names for some of the variables.&lt;/P&gt;
&lt;P&gt;You can test this with the following bits of code:&lt;/P&gt;
&lt;PRE&gt;proc means data=sashelp.class noprint nway;
   class sex;
   var height weight;
   output out=wrong  max= min= std=
   ;
run;&lt;/PRE&gt;
&lt;P&gt;Which generates warnings in the log about variables already exist in the output data set. Since MAX is listed first that is the only value in the output.&lt;/P&gt;
&lt;P&gt;The following shows how to rename the statistics for each variable with specific names&lt;/P&gt;
&lt;PRE&gt;proc means data=sashelp.class noprint nway;
   class sex;
   var height weight;
   output out=wrong  max= min(height weight)=minh minw std(height weight)=hstd wstd
   ;
run;&lt;/PRE&gt;
&lt;P&gt;The name of the variable on the VAR statement goes in () after the statistic and the name(s) of the output variables follow the = . The number of variables and new names need to match. Order is &lt;STRONG&gt;critical&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;Or you can let SAS help you out with (mostly) predictable names:&lt;/P&gt;
&lt;PRE&gt;proc means data=sashelp.class noprint nway;
   class sex;
   var height weight;
   output out=wrong  max= min= std= /autoname
   ;
run;&lt;/PRE&gt;
&lt;P&gt;The autoname option will name the output variables by appending the statistic to the variable name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One of the things you didn't ask about but can be quite helpful was the NWAY option. If you do not include NWAY then you will get combinations of the class variables. I have found this quite helpful because I get the summaries of literally dozens of likely combinations of variables. The _type_ variable in the output indicates which combination a set of records represents. So with one pass through the data I had a data set that contained in on project summaries at:&lt;/P&gt;
&lt;P&gt;Statewide&lt;/P&gt;
&lt;P&gt;Geographic region&lt;/P&gt;
&lt;P&gt;County&lt;/P&gt;
&lt;P&gt;School District&lt;/P&gt;
&lt;P&gt;School type (public/private)&lt;/P&gt;
&lt;P&gt;School&lt;/P&gt;
&lt;P&gt;Grade&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Geographic region by school district&lt;/P&gt;
&lt;P&gt;Geographic region by school type&lt;/P&gt;
&lt;P&gt;Geographic region by grade&lt;/P&gt;
&lt;P&gt;Geographic region by school type by grade&lt;/P&gt;
&lt;P&gt;(and a LOT more combinations).&lt;/P&gt;
&lt;P&gt;This is useful because you can use combinations of WHERE clauses to select records and/or BY variables to Print or other report procedure. I created around 4,000 pages of custom reports different levels of management using ONE output data set (and some additional code to make each type nice in appearance)&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, 10 Jun 2021 20:54:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Questions-on-proc-means-and-more/m-p/747215#M38918</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-06-10T20:54:29Z</dc:date>
    </item>
  </channel>
</rss>

