<?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: Referencing a Summed Column from Proc Tabulate in Proc Report in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Referencing-a-Summed-Column-from-Proc-Tabulate-in-Proc-Report/m-p/211850#M4636</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you not query the SASHELP.VCOLUMN (DICTIONARY.COLUMNS) information, if _sum is always the suffix then:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NAME&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :THE_SUM_VAR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DICTIONARY.COLUMNS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LIBNAME="WORK" and MEMNAME="ABC";&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use the macro variable.&amp;nbsp; If _sum isn't the suffix always, take a list of your variables before and after and remove the before from the after to be left with additional variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 May 2015 14:13:16 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2015-05-08T14:13:16Z</dc:date>
    <item>
      <title>Referencing a Summed Column from Proc Tabulate in Proc Report</title>
      <link>https://communities.sas.com/t5/Developers/Referencing-a-Summed-Column-from-Proc-Tabulate-in-Proc-Report/m-p/211849#M4635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am formatting data using proc tabulate for when I call the data in proc report.&amp;nbsp; I need to know the name of the columns from proc tabulate to reference them in proc report.&amp;nbsp; This works until I add in the sum feature in proc tabulate.&amp;nbsp; I’m not sure what my variable is called after I add in the sum feature. In this particular scenario the summed variable is students_enrolled_sum.&amp;nbsp; However if I change out the location column with a marco &amp;amp;columnName identifying the column name gets tricky.&amp;nbsp; Without the sum my column name is always n.&amp;nbsp; I tried using labels however the label appears to only be a label and not a name as can be seen in a proc print statement like the print screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc tabulate data=enrollment missing out=enrollment4 FORMAT=COMMA8.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; class location academic_period;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var students_enrolled;&lt;/P&gt;&lt;P&gt;&amp;nbsp; table sum*location='n'*students_enrolled='' sum*students_enrolled=' '*all, academic_period /row=float;&lt;/P&gt;&lt;P&gt;&amp;nbsp; keylabel sum=' ' n=' ';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=enrollment4;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="tabulate_n.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/10313_tabulate_n.png" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2015 14:04:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Referencing-a-Summed-Column-from-Proc-Tabulate-in-Proc-Report/m-p/211849#M4635</guid>
      <dc:creator>DavidPhillips2</dc:creator>
      <dc:date>2015-05-08T14:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing a Summed Column from Proc Tabulate in Proc Report</title>
      <link>https://communities.sas.com/t5/Developers/Referencing-a-Summed-Column-from-Proc-Tabulate-in-Proc-Report/m-p/211850#M4636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you not query the SASHELP.VCOLUMN (DICTIONARY.COLUMNS) information, if _sum is always the suffix then:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NAME&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :THE_SUM_VAR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DICTIONARY.COLUMNS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LIBNAME="WORK" and MEMNAME="ABC";&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use the macro variable.&amp;nbsp; If _sum isn't the suffix always, take a list of your variables before and after and remove the before from the after to be left with additional variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2015 14:13:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Referencing-a-Summed-Column-from-Proc-Tabulate-in-Proc-Report/m-p/211850#M4636</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-08T14:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing a Summed Column from Proc Tabulate in Proc Report</title>
      <link>https://communities.sas.com/t5/Developers/Referencing-a-Summed-Column-from-Proc-Tabulate-in-Proc-Report/m-p/211851#M4637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; background: white;"&gt;I used the concatenate function to combined &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; background: white;"&gt;location || sum to reference my variables dynamically. This works for me there should be a better way like being able to reference the label name.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2015 14:24:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Referencing-a-Summed-Column-from-Proc-Tabulate-in-Proc-Report/m-p/211851#M4637</guid>
      <dc:creator>DavidPhillips2</dc:creator>
      <dc:date>2015-05-08T14:24:43Z</dc:date>
    </item>
  </channel>
</rss>

