<?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: summarize table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/summarize-table/m-p/726922#M225968</link>
    <description>&lt;P&gt;Your data step does not create data similar to your picture. This does:&lt;/P&gt;
&lt;PRE&gt;data AE;
   infile datalines dlm=',';
input USUBJID :$3. AEBODSYS :$30. AEDECOD :$20. ;
datalines;
101,Cardiac disorders,Atrial flutter
101,Gastrointestinal disorders,Constipation
102,Cardiac disorders,Cardiac failure
102,Psychiatric disorders,Delirium
103,Cardiac disorders,Palpitations
103,Cardiac disorders,Palpitations
103,Cardiac disorders,Tachycardia
run;

 &lt;/PRE&gt;
&lt;P&gt;Your code was reading from fixed columns. If it worked before you pasted it to the forum you need to know that the main message windows reformat text and will remove repeated blanks and other forms of "white space". So it is best to place code in to a text box opened on the forum as above to keep formatting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data almost certainly should stay in the current form for any sort of analysis.&lt;/P&gt;
&lt;P&gt;Can you describe how you intend to use that data with all the variable in one column?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need groups for analysis or reporting your data may already be as you need.&lt;/P&gt;
&lt;P&gt;Example simple report:&lt;/P&gt;
&lt;PRE&gt;Proc tabulate data=AE;
   Class  AEBODSYS  AEDECOD ;
   table  AEBODSYS * AEDECOD,
         n
   ;
run;

 
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Mar 2021 21:38:55 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-03-16T21:38:55Z</dc:date>
    <item>
      <title>summarize table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/summarize-table/m-p/726910#M225959</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;i want to change this table that will make one variable with aebodsys as main category and aedecod as subcategories.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jedrzej_0-1615927727223.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/56032iEED6071A345DB481/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jedrzej_0-1615927727223.png" alt="Jedrzej_0-1615927727223.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;like that&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;VAR&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Cardiac disorder&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;atrial flutter&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;palpitations&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Tachycardia&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Cardiac failrue&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Psychiatric disorders&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Delirium&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Gastrointestinal disorders&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Constipation&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data AE;&lt;BR /&gt;input USUBJID $ 1-3 AEBODSYS $ 5-30 AEDECOD $ 32-49 ;&lt;BR /&gt;datalines;&lt;BR /&gt;101 Cardiac disorders Atrial flutter&lt;BR /&gt;101 Gastrointestinal disorders Constipation&lt;BR /&gt;102 Cardiac disorders Cardiac failure&lt;BR /&gt;102 Psychiatric disorders Delirium&lt;BR /&gt;103 Cardiac disorders Palpitations&lt;BR /&gt;103 Cardiac disorders Palpitations&lt;BR /&gt;103 Cardiac disorders Tachycardia&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you for your help&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 20:56:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/summarize-table/m-p/726910#M225959</guid>
      <dc:creator>Jedrzej</dc:creator>
      <dc:date>2021-03-16T20:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: summarize table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/summarize-table/m-p/726922#M225968</link>
      <description>&lt;P&gt;Your data step does not create data similar to your picture. This does:&lt;/P&gt;
&lt;PRE&gt;data AE;
   infile datalines dlm=',';
input USUBJID :$3. AEBODSYS :$30. AEDECOD :$20. ;
datalines;
101,Cardiac disorders,Atrial flutter
101,Gastrointestinal disorders,Constipation
102,Cardiac disorders,Cardiac failure
102,Psychiatric disorders,Delirium
103,Cardiac disorders,Palpitations
103,Cardiac disorders,Palpitations
103,Cardiac disorders,Tachycardia
run;

 &lt;/PRE&gt;
&lt;P&gt;Your code was reading from fixed columns. If it worked before you pasted it to the forum you need to know that the main message windows reformat text and will remove repeated blanks and other forms of "white space". So it is best to place code in to a text box opened on the forum as above to keep formatting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data almost certainly should stay in the current form for any sort of analysis.&lt;/P&gt;
&lt;P&gt;Can you describe how you intend to use that data with all the variable in one column?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need groups for analysis or reporting your data may already be as you need.&lt;/P&gt;
&lt;P&gt;Example simple report:&lt;/P&gt;
&lt;PRE&gt;Proc tabulate data=AE;
   Class  AEBODSYS  AEDECOD ;
   table  AEBODSYS * AEDECOD,
         n
   ;
run;

 
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 21:38:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/summarize-table/m-p/726922#M225968</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-16T21:38:55Z</dc:date>
    </item>
  </channel>
</rss>

