<?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: How to create analysis variable at diff level than input file level? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-analysis-variable-at-diff-level-than-input-file/m-p/245208#M45727</link>
    <description>&lt;P&gt;You're looking for summary functions.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS SQL and PROC MEANS are two standard way to obtain descriptive statistics and aggregate data.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jan 2016 15:33:12 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-01-21T15:33:12Z</dc:date>
    <item>
      <title>How to create analysis variable at diff level than input file level?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-analysis-variable-at-diff-level-than-input-file/m-p/245147#M45699</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm wondering if anyone has suggestions for how I could create some meal-level and school-level variables from a food-level file. More specifically,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Input file is a food item-level file of about&amp;nbsp;200,000 food items, where each record has variables to&amp;nbsp;indicate the school ID, weekday (num, 1-5), the meal (lunch/breakfast), the food category (five categories), and multiple variables to indicate nutrient contents for that food item. Since these are food-level files, any school-level and menu-level variables repeat for each food within a school or day. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How would I tell SAS to give me a variable of the minimum of a certain nutrient (ie lowest fat) at a specific school, on a day, during lunch meal, and within one food category.&amp;nbsp; What kind of functions would I use to get to this school-level variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Due to the size and structure of the input file, I'm opting not to do a basic proc transpose at the beginning of this work to convert the food level file to a school - level one. I'm wondering if there s other data/proc? step processing I can do to get to where I need to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would you let me know if I should clarify?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 12:30:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-analysis-variable-at-diff-level-than-input-file/m-p/245147#M45699</guid>
      <dc:creator>Maisha_Huq</dc:creator>
      <dc:date>2016-01-21T12:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to create analysis variable at diff level than input file level?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-analysis-variable-at-diff-level-than-input-file/m-p/245151#M45703</link>
      <description>&lt;P&gt;Its hard to say, post a datastep with some test data,and what you want out. &amp;nbsp;There is min(), arrays, retain etc. any of which could work.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 12:29:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-analysis-variable-at-diff-level-than-input-file/m-p/245151#M45703</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-01-21T12:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to create analysis variable at diff level than input file level?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-analysis-variable-at-diff-level-than-input-file/m-p/245157#M45706</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort
  data=have (
    where=(
      school="school" and
      weekday=X and
      category="category" and
      meal='Lunch'
    )
  )
  out=want
;
by nutrient_content;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The first observation would then be the one with the lowest content for your selection.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 12:49:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-analysis-variable-at-diff-level-than-input-file/m-p/245157#M45706</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-01-21T12:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to create analysis variable at diff level than input file level?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-analysis-variable-at-diff-level-than-input-file/m-p/245208#M45727</link>
      <description>&lt;P&gt;You're looking for summary functions.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS SQL and PROC MEANS are two standard way to obtain descriptive statistics and aggregate data.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 15:33:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-analysis-variable-at-diff-level-than-input-file/m-p/245208#M45727</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-21T15:33:12Z</dc:date>
    </item>
  </channel>
</rss>

