<?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 do I create a format for grouping results from a data set list? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-format-for-grouping-results-from-a-data-set/m-p/362877#M274852</link>
    <description>&lt;P&gt;The ungrouped data would be the version required to create a format.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data format_me;&lt;/P&gt;
&lt;P&gt;set ungrouped (rename=(ct=start mssa_id=label));&lt;/P&gt;
&lt;P&gt;fmtname = '$mssa_gp';&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have the proper variable names assigned, creating a format is easy:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc format cntlin=format_me;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Later, to apply the format:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;format mssa_id $mssa_gp.;&lt;/P&gt;</description>
    <pubDate>Tue, 30 May 2017 20:55:59 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2017-05-30T20:55:59Z</dc:date>
    <item>
      <title>How do I create a format for grouping results from a data set list?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-format-for-grouping-results-from-a-data-set/m-p/362859#M274849</link>
      <description>&lt;P&gt;I am trying to group census tract level populations into Medical Service Study Areas (MSSA), each of which comprise of a unique, mutually exclusive list of census tracts. &amp;nbsp;I have managed to get the census tract numbers organized by MSSA in a column, separated by commas:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data=have&lt;/P&gt;&lt;P&gt;Obs &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ct&amp;nbsp;(char) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MSSA_ID (char)&lt;/P&gt;&lt;P&gt;&amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1210,1202,1300,1401.... &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0701,1101,1501,1504.... &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2a&lt;/P&gt;&lt;P&gt;&amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0100,0200,7101,1700.... &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2b&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I want to efficiently apply this as a format to a data set that contains the population of each census tract:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data=census_data&lt;/P&gt;&lt;P&gt;census_tract &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;population&lt;/P&gt;&lt;P&gt;1210 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4581&lt;/P&gt;&lt;P&gt;1202 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5142&lt;/P&gt;&lt;P&gt;0701 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7412&lt;/P&gt;&lt;P&gt;1101 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6233&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So that I can get the total population of each MSSA:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data=want&lt;/P&gt;&lt;P&gt;MSSA_ID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;total_population&lt;/P&gt;&lt;P&gt;1.1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9723&lt;/P&gt;&lt;P&gt;2a &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 13645&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 20:27:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-format-for-grouping-results-from-a-data-set/m-p/362859#M274849</guid>
      <dc:creator>DKAllgeier</dc:creator>
      <dc:date>2017-05-30T20:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a format for grouping results from a data set list?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-format-for-grouping-results-from-a-data-set/m-p/362866#M274850</link>
      <description>&lt;P&gt;It would be easier if you had ungrouped data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MSSA_ID&lt;/P&gt;
&lt;P&gt;1210&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.1&lt;/P&gt;
&lt;P&gt;1202&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.1&lt;/P&gt;
&lt;P&gt;1300&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.1&lt;/P&gt;
&lt;P&gt;0701&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2a&lt;/P&gt;
&lt;P&gt;1101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2a&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's just a small sampling of course.&amp;nbsp; Do you have the data available in that form?&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 20:39:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-format-for-grouping-results-from-a-data-set/m-p/362866#M274850</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-05-30T20:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a format for grouping results from a data set list?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-format-for-grouping-results-from-a-data-set/m-p/362869#M274851</link>
      <description>&lt;P&gt;Yes, I do have the data in that form. &amp;nbsp;I was able to get the answers by merging that data set with the census_tract data set&amp;nbsp;in a proc sql step, but I was hoping to be able to use a format. &amp;nbsp;I will have to apply the same groups to other counts in the future and want to avoid excess merges.&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 20:45:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-format-for-grouping-results-from-a-data-set/m-p/362869#M274851</guid>
      <dc:creator>DKAllgeier</dc:creator>
      <dc:date>2017-05-30T20:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a format for grouping results from a data set list?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-format-for-grouping-results-from-a-data-set/m-p/362877#M274852</link>
      <description>&lt;P&gt;The ungrouped data would be the version required to create a format.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data format_me;&lt;/P&gt;
&lt;P&gt;set ungrouped (rename=(ct=start mssa_id=label));&lt;/P&gt;
&lt;P&gt;fmtname = '$mssa_gp';&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have the proper variable names assigned, creating a format is easy:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc format cntlin=format_me;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Later, to apply the format:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;format mssa_id $mssa_gp.;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 20:55:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-format-for-grouping-results-from-a-data-set/m-p/362877#M274852</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-05-30T20:55:59Z</dc:date>
    </item>
  </channel>
</rss>

