<?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 to count frequency from Dataset B to populate a new column in Dataset A in SAS EG 7.1 in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495527#M19</link>
    <description>&lt;P&gt;Yep that's what I meant. Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;for running me through my questions.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Sep 2018 21:15:55 GMT</pubDate>
    <dc:creator>Luciferene</dc:creator>
    <dc:date>2018-09-13T21:15:55Z</dc:date>
    <item>
      <title>How to count frequency from Dataset B to populate a new column in Dataset A in SAS EG 7.1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495373#M2</link>
      <description>&lt;P&gt;Hello community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm very new to SAS and I've been struggling to efficiently do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So following are examples of the datasets:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dataset A:&lt;/P&gt;&lt;P&gt;A 0.86&lt;/P&gt;&lt;P&gt;B 1.25&lt;/P&gt;&lt;P&gt;C 1.01&lt;/P&gt;&lt;P&gt;D 1.35&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dataset B (Columns: Category 1 Category 2):&lt;/P&gt;&lt;P&gt;A&amp;nbsp;A&lt;/P&gt;&lt;P&gt;A B&lt;/P&gt;&lt;P&gt;B&amp;nbsp;B&lt;/P&gt;&lt;P&gt;A&amp;nbsp;A&lt;/P&gt;&lt;P&gt;C&amp;nbsp;C&lt;/P&gt;&lt;P&gt;A&amp;nbsp;D&lt;/P&gt;&lt;P&gt;D&amp;nbsp;B&lt;/P&gt;&lt;P&gt;A&amp;nbsp;D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I want to Dataset A to look like, or create a new Dataset C that looks like (With columns being Classes, rates, #Cat 1 from Dataset A, #Cat 2 from Dataset B):&lt;/P&gt;&lt;P&gt;A 0.86 5 2&lt;/P&gt;&lt;P&gt;B 1.25 1 3&lt;/P&gt;&lt;P&gt;C 1.01 1 1&lt;/P&gt;&lt;P&gt;D 1.35 1 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I'm&amp;nbsp;using One Way Freq to do the count for Cat 1 and Cat 2 for Dataset B. And combining frequency column from those two with Data A and it's very messy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for help!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 15:45:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495373#M2</guid>
      <dc:creator>Luciferene</dc:creator>
      <dc:date>2018-09-13T15:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to count frequency from Dataset B to populate a new column in Dataset A in SAS EG 7.1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495392#M3</link>
      <description>&lt;P&gt;Is it just 2 categories in dataset b or the number of categories in b could vary?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 16:27:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495392#M3</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-13T16:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to count frequency from Dataset B to populate a new column in Dataset A in SAS EG 7.1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495416#M4</link>
      <description>&lt;P&gt;I'm only counting from 2 categories, but dataset b does have many other columns that are not being counted.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 17:27:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495416#M4</guid>
      <dc:creator>Luciferene</dc:creator>
      <dc:date>2018-09-13T17:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to count frequency from Dataset B to populate a new column in Dataset A in SAS EG 7.1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495425#M5</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/233144"&gt;@Luciferene&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm only &lt;U&gt;&lt;EM&gt;"&lt;STRONG&gt;counting from 2 categories"&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;&lt;/U&gt;but dataset b does have many other columns that are not being counted.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data A;
input Cat1 $ n ;
cards;
A 0.86
B 1.25
C 1.01
D 1.35
;

data b;
input  Cat1 $ Cat2 $;
cards;
A A
A B
B B
A A
C C
A D
D B
A D
;

data _null_;
if _n_=1 then do;
if 0 then set A;
  dcl hash H (ordered:'y') ;
   h.definekey  ("Cat1") ;
   h.definedata ("Cat1","n","freq1","freq2") ;
   h.definedone () ;
end;
call missing(freq1,freq2);
do until(lr);
set a end=lr;
rc=h.add();
end;
lr=0;
do until(lr);
set b end=lr;
if h.find(key:Cat1) ne 0 then freq1=1;else freq1=sum(freq1,1);
h.replace();
if h.find(key:Cat2) ne 0 then freq2=1;else freq2=sum(freq2,1);
h.replace();
end;
h.output(dataset:'want');
stop;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Thu, 13 Sep 2018 17:44:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495425#M5</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-13T17:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to count frequency from Dataset B to populate a new column in Dataset A in SAS EG 7.1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495428#M6</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/233144"&gt;@Luciferene&lt;/a&gt;&amp;nbsp;Btw, welcome to the forum as it appears this is just your 1st thread. If there are many categories, that approach can be tweaked to do some gymnastics using arrays, however me being extremely lazy I haven't done that until needed.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 13:48:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495428#M6</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-14T13:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to count frequency from Dataset B to populate a new column in Dataset A in SAS EG 7.1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495445#M7</link>
      <description>&lt;P&gt;Thanks a lot &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;for the welcome and the help, this is what I was looking for!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Few (probably very basic) questions:&lt;/P&gt;&lt;P&gt;How would I go about reordering the rows? For example if I want them in B C D A, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I wanted to operate on something like SUM(n * freq1) / SUM(freq1), how would I do that? It doesn't seem to let me operate on the values like matrix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you can give me any guidance or point me in the direction to learn that would be great.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 18:21:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495445#M7</guid>
      <dc:creator>Luciferene</dc:creator>
      <dc:date>2018-09-13T18:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to count frequency from Dataset B to populate a new column in Dataset A in SAS EG 7.1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495453#M8</link>
      <description>&lt;P&gt;Can you please elaborate a bit more. As in, this&amp;nbsp;&lt;SPAN&gt;SUM(n * freq1) / SUM(freq1), do you want to apply this on the output dataset?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;May be it would help if you show your desired using a sample like you did in your question to think through technically&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And for reordering rows, please let know the logic for the order you want.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I am going for lunch(Chicago&amp;nbsp;time) with my mates, and there might be delay in my responses. Kindly bear with me&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 18:37:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495453#M8</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-13T18:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to count frequency from Dataset B to populate a new column in Dataset A in SAS EG 7.1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495457#M9</link>
      <description>&lt;P&gt;Yes I'm working with the output. So if the output comes out to be (Category, n , freq1, freq2 for columns):&lt;/P&gt;&lt;P&gt;A 0.86 5 2&lt;/P&gt;&lt;P&gt;B 1.25 1 3&lt;/P&gt;&lt;P&gt;C 1.01 1 1&lt;/P&gt;&lt;P&gt;D 1.35 1 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want&amp;nbsp;&lt;SPAN&gt;SUM(n * freq1) / SUM(freq1) = (0.86 * 5 + 1.25 * 1 + ...) / (0.86 + 1.25 + ...). I know how to do this if it was say matrix, but my attempt at doing it for dataset keeps giving me errors.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For the reordering, when the output data orders everything alphabetically where as the categories are set in certain order. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For example i&lt;SPAN&gt;f my Categories were initially laid out as:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Standard&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPA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AN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;It's more or less for the summary report.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Of course,&amp;nbsp;enjoy your lunch!&amp;nbsp;Thanks for your prompt responses. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 18:48:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495457#M9</guid>
      <dc:creator>Luciferene</dc:creator>
      <dc:date>2018-09-13T18:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to count frequency from Dataset B to populate a new column in Dataset A in SAS EG 7.1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495461#M10</link>
      <description>Just adding on, I would ideally like the result to be added onto the output data.&lt;BR /&gt;For example:&lt;BR /&gt;A 0.86 5 2&lt;BR /&gt;B 1.25 1 3&lt;BR /&gt;C 1.01 1 1&lt;BR /&gt;D 1.35 1 2&lt;BR /&gt;Total, (blank), 8, 8&lt;BR /&gt;Weighted AVG, (blank), For freq 1, For freq 2&lt;BR /&gt;&lt;BR /&gt;Where the weighted avg is SUM(n * freq1) / SUM(freq1). My apologise for messy alignment.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Sep 2018 18:58:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495461#M10</guid>
      <dc:creator>Luciferene</dc:creator>
      <dc:date>2018-09-13T18:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to count frequency from Dataset B to populate a new column in Dataset A in SAS EG 7.1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495464#M11</link>
      <description>&lt;P&gt;Can you clarify whether the following result is what you want that needs to be appended to the prev output which is in &lt;STRONG&gt;have?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Cat1 $ n freq1 freq2;
cards;
A 0.86 5 2
B 1.25 1 3
C 1.01 1 1
D 1.35 1 2
;


proc sql;
create table want as
select SUM(n * freq1)/SUM(freq1)  as wgt_avg_for_freq1, SUM(n * freq2)/SUM(freq2) as wgt_avg_for_freq2,sum(freq1) as sum_freq1,sum(freq1) as sum_freq2
from have;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Sep 2018 19:10:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495464#M11</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-13T19:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to count frequency from Dataset B to populate a new column in Dataset A in SAS EG 7.1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495467#M12</link>
      <description>&lt;P&gt;Yep that's correct.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 19:17:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495467#M12</guid>
      <dc:creator>Luciferene</dc:creator>
      <dc:date>2018-09-13T19:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to count frequency from Dataset B to populate a new column in Dataset A in SAS EG 7.1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495506#M13</link>
      <description>&lt;P&gt;Thank you, but I am afraid that result won't align&amp;nbsp; correctly when we stack with the output from the previous.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or&amp;nbsp; now that you have both the results, can you stack and show the desired one to be precise. It also sounds to me that you might want a report from a prco tabulate or proc report&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 20:40:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495506#M13</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-13T20:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to count frequency from Dataset B to populate a new column in Dataset A in SAS EG 7.1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495515#M14</link>
      <description>&lt;P&gt;I'm&amp;nbsp;not exactly sure if I understood you correctly, but this is basically the final form that I desire:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;A           0.86    5              2
B           1.25    1              3
C           1.01    1              1
D           1.35    1              2
Total               8              8
WA                  0.98875        1.1475&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Where the 2nd column (n) is blank. Basically the final two rows are summaries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 20:48:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495515#M14</guid>
      <dc:creator>Luciferene</dc:creator>
      <dc:date>2018-09-13T20:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to count frequency from Dataset B to populate a new column in Dataset A in SAS EG 7.1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495517#M15</link>
      <description>&lt;P&gt;Aah, you understood well. Thank you &amp;amp; brb&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 20:49:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495517#M15</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-13T20:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to count frequency from Dataset B to populate a new column in Dataset A in SAS EG 7.1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495520#M16</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*This WANT is the output from the previous, 
just recreating from demo purpose*/
data want;
input Cat1 $ n freq1 freq2;
cards;
A 0.86 5 2
B 1.25 1 3
C 1.01 1 1
D 1.35 1 2
;

/*Final want*/
proc sql;
create table final_want as
select * from want
union 
select 'Total' as Cat1,. as n, sum(freq1) as sum_freq1,sum(freq1) as sum_freq2 from want
union 
select 'WA' as Cat1,. as n,SUM(n * freq1)/SUM(freq1)  as freq1,SUM(n * freq2)/SUM(freq2) as freq2 from want;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Sep 2018 20:59:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495520#M16</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-13T20:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to count frequency from Dataset B to populate a new column in Dataset A in SAS EG 7.1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495523#M17</link>
      <description>&lt;P&gt;Perfect, I got exactly what I wanted. Thanks a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just curious, why is there .(period) after ,(comma)&amp;nbsp;for &lt;SPAN class="token statement"&gt;select&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'Total'&lt;/SPAN&gt; as Cat1&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token punctuation"&gt;Is it SQL protocol?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 21:08:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495523#M17</guid>
      <dc:creator>Luciferene</dc:creator>
      <dc:date>2018-09-13T21:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to count frequency from Dataset B to populate a new column in Dataset A in SAS EG 7.1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495524#M18</link>
      <description>&lt;P&gt;you mean .(period) as n&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;. period is notation for assigning missing values like call missing aka blank values&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 21:11:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495524#M18</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-13T21:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to count frequency from Dataset B to populate a new column in Dataset A in SAS EG 7.1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495527#M19</link>
      <description>&lt;P&gt;Yep that's what I meant. Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;for running me through my questions.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 21:15:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-count-frequency-from-Dataset-B-to-populate-a-new-column/m-p/495527#M19</guid>
      <dc:creator>Luciferene</dc:creator>
      <dc:date>2018-09-13T21:15:55Z</dc:date>
    </item>
  </channel>
</rss>

