<?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: Using proc report in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924145#M363760</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting an error here. please what am I doing incorrectly&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sql;
create table test4 as
select a.*, b.Active as Active_total, 
	(b.Active/Active_total)*100 as Active_pct

from test3 a
	left join test3 b 
(where=( b.serv_ord='TOTAL')) 
		and a.table=b.table;

quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;NOTE: Writing HTML5(EGHTML) Body file: EGHTML&lt;BR /&gt;27&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;28 proc sql;&lt;BR /&gt;29 create table test4 as&lt;BR /&gt;30 select a.*, b.Active as Active_total,&lt;BR /&gt;31 (b.Active/Active_total)*100 as Active_pct&lt;BR /&gt;32&lt;BR /&gt;33 from test3 a&lt;BR /&gt;34 left join test3 b&lt;BR /&gt;35 (where=( b.serv_ord='TOTAL'))&lt;BR /&gt;_&lt;BR /&gt;73&lt;BR /&gt;76&lt;BR /&gt;ERROR 73-322: Expecting an ON.&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;36 and a.table=b.table;&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;37&lt;BR /&gt;38 quit;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;Note:&lt;/P&gt;</description>
    <pubDate>Fri, 12 Apr 2024 15:43:55 GMT</pubDate>
    <dc:creator>CathyVI</dc:creator>
    <dc:date>2024-04-12T15:43:55Z</dc:date>
    <item>
      <title>Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924091#M363744</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I need help. I am just learning proc report. I have created a demo of my data and desired output. Numb&amp;nbsp; is the count of boys in table 2796 who are active.&amp;nbsp; I would to use PROC REPORT to generate this output. Thanks&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data test;
input serv$ 1-5	table$ 6-10	comp$ 11-18	numb 19-28;
datalines;
Boy	  2796	Active    41043
Boy	  2796	Reserve	  7024
Boy	  2796	missing   72
Boy   PHA	Active	  274220
Boy   PHA	Reserve   95291
Girl  2796	Active    3200
Girl  2796	Reserve	  1231
Girl  2796	missing	  5
Girl  PHA	Active	  121634
Girl  PHA	Reserve	  36043
Dad   2796	Active	  9915
Dad   2796	Reserve	  310
TOTAL 2796	Active	  77283
; run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;desire output&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Comp&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Serv&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Table&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&l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;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;PHA&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;2796&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 12 Apr 2024 12:40:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924091#M363744</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2024-04-12T12:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924095#M363745</link>
      <description>&lt;P&gt;Regarding the columns for %&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To compute a percent, we need a numerator and a denominator. Please state clearly the numerator and denominator of this percent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, your code does not work as shown. Please test your code before you post it. Testing is a good thing, and should be considered mandatory. The code shown needs to be fixed. By providing properly tested code, you won't be wasting our time and you will get faster answers.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 12:55:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924095#M363745</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-04-12T12:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924098#M363746</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; Thank you. I created the dummy code in sas, so I tested it. I just copied directly maybe there is something am not doing right, i will appreciate your guidance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My numerator is each active, server and missing, while denominator is the total.&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g (active/active_total)*100 as active_pct&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to find the count of each group which i was able to do with proc freq but i dont know how to use proc report.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 13:08:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924098#M363746</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2024-04-12T13:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924099#M363747</link>
      <description>&lt;P&gt;Your code produces a lot of missing values, I assume you don't want that. So it needs to be fixed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;My numerator is each active, server and missing, while denominator is the total.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;e.g (active/active_total)*100 as active_pct&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So for Boy PHA Active, the percent is Boy PHA Active N divided by Total PHA Active N?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 13:14:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924099#M363747</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-04-12T13:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924101#M363748</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; Yes that is correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes I will take care of the missing after I see how it impact the final output. Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 13:20:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924101#M363748</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2024-04-12T13:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924102#M363749</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/253321"&gt;@CathyVI&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; Yes that is correct.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Okay, this doesn't seem to me to be something that can be done (easily) in PROC REPORT. What I typically do is calculate the percents in a DATA step or SQL before I run PROC REPORT. Once those calculations are done, then getting PROC REPORT to display the table you want is much easier.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 13:22:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924102#M363749</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-04-12T13:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924105#M363750</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CathyVI_0-1712928192290.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95495iAF8F0C8A78128B78/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CathyVI_0-1712928192290.png" alt="CathyVI_0-1712928192290.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; I think the table messed up when I copied into SAS. This is how table should look like.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 13:25:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924105#M363750</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2024-04-12T13:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924108#M363751</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; When I tried to read your file, the issue I ran into was the tabs generated missing values with your type of input. This worked better for me.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
length serv $5 table $5 comp $8;
infile datalines dlm=',' dsd;
input serv $ 	table $  comp $  	numb  ;
dataord = _n_;
datalines;
Boy,2796,Active,41043
Boy,2796,Reserve,7024
Boy,2796,missing,72
Boy,PHA,Active,274220
Boy,PHA,Reserve,95291
Girl,2796,Active,3200
Girl,2796,Reserve,1231
Girl,2796,missing,5
Girl,PHA,Active,121634
Girl,PHA,Reserve,36043
Dad,2796,Active,9915
Dad,2796,Reserve,310
TOTAL,2796,Active,77283
; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; I added a "DATAORD" variable to capture the original order of the variables, thinking it might help, but your input data is not in the order shown in your desired results, so I'm not sure it is useful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; However, without some direction or a helper variable, to assure the desired ordering, PROC REPORT would not be able to do the type of ordering you show. What PROC REPORT code have you tried?&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 13:33:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924108#M363751</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2024-04-12T13:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924109#M363752</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/253321"&gt;@CathyVI&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; I think the table messed up when I copied into SAS. This is how table should look like.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's good to know, but I still don't think PROC REPORT will do the calculations (easily). I still think you are better off doing the calculations of percent in a DATA step or SQL, and then use PROC REPORT to display the table.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 13:34:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924109#M363752</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-04-12T13:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924120#M363754</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to transpose then calculated %&amp;nbsp; i could have the desired table format- just as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; said. But I encountered an issue.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sort data= test ;
by serv table comp ; run;
proc transpose data= test out=trans (drop=_name_);
by serv table ;
id comp ; 
var numb;
run;

proc sql;
create table test2 as
select a.*, b.Active as Active_total, 
	(Active/Active_total)*100 as Active_pct

from test a
	left join trans1 (where=( service='TOTAL')) b
		on a.table=b.table;

quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;First issue: With the transpose, how do I get a single column for Active, reserve and missing. i dont want them repeated.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CathyVI_0-1712929389159.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95497iE65D13DB767030FB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CathyVI_0-1712929389159.png" alt="CathyVI_0-1712929389159.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Second issue: How do I calculate the % with my suggested code. I encounter an error&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;ERROR: Ambiguous reference, column Active is in more than one table.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 13:45:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924120#M363754</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2024-04-12T13:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924128#M363756</link>
      <description>&lt;P&gt;How can we know what you did wrong if you don't show us the code?&amp;nbsp;How can we know what you did wrong if you don't show us the fixed code to read in the data? By the way, you seem to be calculating percents in your PROC SQL, but then your table doesn't show percents.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also,&amp;nbsp;&lt;SPAN&gt;If you get errors from running a PROC, you need to show us the log for that PROC — and &lt;STRONG&gt;we need to see every line in the log of that PROC&lt;/STRONG&gt;, including code, errors, warnings and notes.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 14:21:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924128#M363756</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-04-12T14:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924129#M363757</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp; I posted the code here&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sort data= test ;
by serv table comp ; run;
proc transpose data= test out=trans (drop=_name_);
by serv table ;
id comp ; 
var numb;
run;

proc sql;
create table test2 as
select a.*, b.Active as Active_total, 
	(Active/Active_total)*100 as Active_pct

from test a
	left join trans1 (where=( service='TOTAL')) b
		on a.table=b.table;

quit;&lt;BR /&gt;&lt;BR /&gt;27 &lt;BR /&gt;28 proc sql;&lt;BR /&gt;29 create table test2 as&lt;BR /&gt;30 select a.*, b.Active as Active_total,&lt;BR /&gt;31 (Active/Active_total)*100 as Active_pct&lt;BR /&gt;32 &lt;BR /&gt;33 from trans1 a&lt;BR /&gt;34 left join trans1 (where=( service='TOTAL')) b&lt;BR /&gt;35 on a.table=b.table;&lt;BR /&gt;ERROR: Ambiguous reference, column Active is in more than one table.&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;36 &lt;BR /&gt;37 quit;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Apr 2024 14:23:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924129#M363757</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2024-04-12T14:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924143#M363758</link>
      <description>&lt;P&gt;When you join two (or more) tables in SQL, and there is a variable (in this case ACTIVE) that exists in both tables that has the exact same name in each table, you have to refer to the variable as a.ACTIVE or b.ACTIVE so that SQL knows which one you mean. Referring to the variables as ACTIVE is ambiguous, SAS doesn't know which one you mean, and so you get this error message.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 15:19:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924143#M363758</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-04-12T15:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924145#M363760</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting an error here. please what am I doing incorrectly&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sql;
create table test4 as
select a.*, b.Active as Active_total, 
	(b.Active/Active_total)*100 as Active_pct

from test3 a
	left join test3 b 
(where=( b.serv_ord='TOTAL')) 
		and a.table=b.table;

quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;NOTE: Writing HTML5(EGHTML) Body file: EGHTML&lt;BR /&gt;27&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;28 proc sql;&lt;BR /&gt;29 create table test4 as&lt;BR /&gt;30 select a.*, b.Active as Active_total,&lt;BR /&gt;31 (b.Active/Active_total)*100 as Active_pct&lt;BR /&gt;32&lt;BR /&gt;33 from test3 a&lt;BR /&gt;34 left join test3 b&lt;BR /&gt;35 (where=( b.serv_ord='TOTAL'))&lt;BR /&gt;_&lt;BR /&gt;73&lt;BR /&gt;76&lt;BR /&gt;ERROR 73-322: Expecting an ON.&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;36 and a.table=b.table;&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;37&lt;BR /&gt;38 quit;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;Note:&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 15:43:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924145#M363760</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2024-04-12T15:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924148#M363762</link>
      <description>&lt;P&gt;You can't use&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;(where=( b.serv_ord='TOTAL')) &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;after the letter B. This is a DATA set option, it must go after the data set name. And since it is a DATA set option, you want the proper syntax here, which is&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;(where=(serv_ord='TOTAL')) &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Apr 2024 15:57:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924148#M363762</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-04-12T15:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924152#M363763</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is wrong with my code here&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;NOTE: Writing HTML5(EGHTML) Body file: EGHTML
27         
28         proc sql;
29         create table test4 as
30         select a.*, b.Active as Active_total,
31         	(Active/Active_total)*100 as Active_pct
32         
33         from test3 a
34         	left join test3 b
35          (where=( serv_ord='_6TOTAL'))
            _
            73
            76
&lt;FONT color="#FF0000"&gt;ERROR 73-322: Expecting an ON.

ERROR 76-322: Syntax error, statement will be ignored.&lt;/FONT&gt;

36         	 on	 a.table=b.table;
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
37         
38         quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds
      &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Apr 2024 16:52:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924152#M363763</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2024-04-12T16:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924153#M363764</link>
      <description>&lt;P&gt;This was explained in my previous post at&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924148#M363762" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924148#M363762&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You didn't make the changes (plural) that I suggested. You only made one change.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 16:56:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924153#M363764</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-04-12T16:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924157#M363765</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;Sorry I did not understand what other changes you mean. I read it but I did not understand. Please can you elaborate.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 17:11:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924157#M363765</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2024-04-12T17:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924160#M363767</link>
      <description>&lt;P&gt;You can't use&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;(where=( b.serv_ord='TOTAL')) &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;after the letter B. This is a DATA set option, it must go after the data set name.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 17:17:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924160#M363767</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-04-12T17:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924182#M363771</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;Thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have clean up the data and this is the output I have now. I am getting close to my goal but I need help in calculating percentage for each of the count. For example: I want the n(%) for Boy in PHA(table) who are Active, N(%) for Boy in 2796 who are active and so on.&amp;nbsp; I want for the reserve group too. Just like my desired table I show you earlier.&amp;nbsp; I think I need numerator &amp;amp; denominator. For Boy in PHA who are active, my numerator is 41043/706476 (total PHA). I want to do this for both active and reserve group, so I can have a similar outcome that i can output with proc report. Thanks for you help&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CathyVI_1-1712944242105.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95517i1E5DE5522C2FE21C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CathyVI_1-1712944242105.png" alt="CathyVI_1-1712944242105.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I test this code for the percent but it's not given me desire output&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sql;
create table want as
select serv,count(active) as frequency,
calculated frequency/(select count(*) from test3) as pct format=percent.
from test3
group by serv, table;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CathyVI_2-1712944571281.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95518iCF8F48A42C7D7E4C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CathyVI_2-1712944571281.png" alt="CathyVI_2-1712944571281.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 17:58:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-proc-report/m-p/924182#M363771</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2024-04-12T17:58:13Z</dc:date>
    </item>
  </channel>
</rss>

