<?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: Assign groups in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Assign-groups/m-p/806345#M317676</link>
    <description>&lt;P&gt;It is for a summary and table output.&amp;nbsp; Need to assign group based on the test and visitnum, but visitnum 101 and 108 need to be in the same group.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Apr 2022 16:46:55 GMT</pubDate>
    <dc:creator>JillChen0131</dc:creator>
    <dc:date>2022-04-06T16:46:55Z</dc:date>
    <item>
      <title>Assign groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-groups/m-p/806186#M317597</link>
      <description>&lt;P&gt;I need to group the dataset by different ways. (1) within the same test, visitnum 101 and 108 should be in the same group,&amp;nbsp; other visitnums in their own group. (2) every different test + visitnum in a group. (3) every test in a group. These 3 ways can be done separately.&amp;nbsp; Sample dataset as below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input test$ visitnum ord seq;&lt;BR /&gt;datalines;&lt;BR /&gt;aa 101 0 0&lt;BR /&gt;aa 101 0 1&lt;BR /&gt;aa 101 0 2&lt;BR /&gt;aa 101 0 3&lt;BR /&gt;aa 101 0 4&lt;BR /&gt;aa 108 1 0&lt;BR /&gt;aa 108 1 1&lt;BR /&gt;aa 108 1 2&lt;BR /&gt;aa 108 1 3&lt;BR /&gt;aa 108 1 4&lt;BR /&gt;aa 108 2 0&lt;BR /&gt;aa 108 2 1&lt;BR /&gt;aa 108 2 2&lt;BR /&gt;aa 108 2 3&lt;BR /&gt;aa 108 2 4&lt;BR /&gt;aa 115 1 0&lt;BR /&gt;aa 115 1 1&lt;BR /&gt;aa 115 1 2&lt;BR /&gt;aa 115 1 3&lt;BR /&gt;aa 115 1 4&lt;BR /&gt;aa 115 2 0&lt;BR /&gt;aa 115 2 1&lt;BR /&gt;aa 115 2 2&lt;BR /&gt;aa 115 2 3&lt;BR /&gt;aa 115 2 4&lt;BR /&gt;bb 101 0 0&lt;BR /&gt;bb 101 0 1&lt;BR /&gt;bb 101 0 2&lt;BR /&gt;bb 101 0 3&lt;BR /&gt;bb 101 0 4&lt;BR /&gt;bb 108 1 0&lt;BR /&gt;bb 108 1 1&lt;BR /&gt;bb 108 1 2&lt;BR /&gt;bb 108 1 3&lt;BR /&gt;bb 108 1 4&lt;BR /&gt;bb 108 2 0&lt;BR /&gt;bb 108 2 1&lt;BR /&gt;bb 108 2 2&lt;BR /&gt;bb 108 2 3&lt;BR /&gt;bb 108 2 4&lt;BR /&gt;bb 115 1 0&lt;BR /&gt;bb 115 1 1&lt;BR /&gt;bb 115 1 2&lt;BR /&gt;bb 115 1 3&lt;BR /&gt;bb 115 1 4&lt;BR /&gt;bb 115 2 0&lt;BR /&gt;bb 115 2 1&lt;BR /&gt;bb 115 2 2&lt;BR /&gt;bb 115 2 3&lt;BR /&gt;bb 115 2 4&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 03:56:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-groups/m-p/806186#M317597</guid>
      <dc:creator>JillChen0131</dc:creator>
      <dc:date>2022-04-06T03:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Assign groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-groups/m-p/806189#M317599</link>
      <description>&lt;P&gt;If you need this in a stat procedure, try a multilabel format.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 04:22:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-groups/m-p/806189#M317599</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-04-06T04:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Assign groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-groups/m-p/806207#M317610</link>
      <description>&lt;P&gt;Group for what purpose? Graph? Count or other summary? Report?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 08:15:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-groups/m-p/806207#M317610</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-04-06T08:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: Assign groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-groups/m-p/806345#M317676</link>
      <description>&lt;P&gt;It is for a summary and table output.&amp;nbsp; Need to assign group based on the test and visitnum, but visitnum 101 and 108 need to be in the same group.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 16:46:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-groups/m-p/806345#M317676</guid>
      <dc:creator>JillChen0131</dc:creator>
      <dc:date>2022-04-06T16:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Assign groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-groups/m-p/806346#M317677</link>
      <description>&lt;P&gt;For #1, create a custom format&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
    value visitf 101,108='101 and 108';
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then assign format visitf. to the variable VISITNUM when you create your analysis, table or graph.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For #2 and #3, it really depends on the report, analysis or graph you are trying to make. I don't think formatting is needed, but we do need more specifics about the report, analysis or graph. For example, if you are just doing a report by variable TEST, I don't think pre-grouping is needed here, PROC REPORT knows how to handle and generate reports where the table is grouped by variable TEST.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 17:09:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-groups/m-p/806346#M317677</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-04-06T17:09:32Z</dc:date>
    </item>
  </channel>
</rss>

