<?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: Newbie data processing question - frequency across two columns? in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/978884#M11515</link>
    <description>&lt;P&gt;Are your Have tables already loaded into CAS or are these just normal SAS files and data prep could also happen under Compute?&lt;BR /&gt;What volumes are you dealing with?&lt;/P&gt;
&lt;P&gt;Is your WANT a table or a report?&lt;BR /&gt;&lt;BR /&gt;For creating a table something like below could work. I can't test it but I believe if all your tables are in CAS then the whole process will execute within CAS.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data writer;
  infile datalines truncover dsd dlm='|';
  input writer:$40.;
  datalines;
Joe
Mac
Maggie
Sam
;

data lead_assistant_project;
  infile datalines truncover dsd dlm='|';
  input Lead_Writer:$40. Assistant_Writer:$40. Project:$40.;
  datalines;
Joe|Mac,Maggie|Earwax for Dummies
Joe||Clock Repair
Sam|Joe|Desk Fans: A Celebration
;

/* restructure your data into a form that's easier to work with */
data writer_role_project;
  length writer $40 role $10;
  set lead_assistant_project;
  keep writer role project;
  
  role='Lead';
  do i=0 to countc(Lead_Writer,',');
    writer=scan(Lead_Writer,i+1,',');
    if not missing(writer) then output;
  end;
 
  role='Assistant';
  do i=0 to countc(Assistant_Writer,',');
    writer=scan(Assistant_Writer,i+1,',');
    if not missing(writer) then output;
  end;
 
run;

proc fedsql;
/*   create table want as */
  select 
    coalesce(t1.writer,t2.writer) as writer
    ,sum(case when t1.project='' then 0 else 1 end) as Total_Projects
    ,sum(case when t1.role='Lead' then 1 else 0 end) as Lead
    ,sum(case when t1.role='Assistant' then 1 else 0 end) as Assistant
  from writer_role_project t1
  full join writer t2 
    on t1.writer=t2.writer
  group by coalesce(t1.writer,t2.writer)
  ;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 15 Nov 2025 00:48:52 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2025-11-15T00:48:52Z</dc:date>
    <item>
      <title>Newbie data processing question - frequency across two columns?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/978881#M11514</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I work with Visual Analytics (probably not a VA question though) and don't have much expertise at data processing, and I'm trying to figure out how to do the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="56.25%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%" height="30px"&gt;&lt;STRONG&gt;Lead Writer&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="25%" height="30px"&gt;&lt;STRONG&gt;Assistant Writer&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="25%" height="30px"&gt;&lt;STRONG&gt;Project&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="30px"&gt;Joe&lt;/TD&gt;
&lt;TD width="25%" height="30px"&gt;Mac, Maggie&lt;/TD&gt;
&lt;TD width="25%" height="30px"&gt;Earwax for Dummies&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="30px"&gt;Joe&lt;/TD&gt;
&lt;TD width="25%" height="30px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="25%" height="30px"&gt;Clock Repair&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="30px"&gt;Sam&lt;/TD&gt;
&lt;TD width="25%" height="30px"&gt;Joe&lt;/TD&gt;
&lt;TD width="25%" height="30px"&gt;Desk Fans: A Celebration&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="100%" height="30px"&gt;&lt;STRONG&gt;All Writers&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="100%" height="30px"&gt;Joe&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="100%" height="30px"&gt;Mac&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Maggie&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="100%" height="30px"&gt;Sam&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Want:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;TABLE border="1" width="44.443781806615775%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;&lt;STRONG&gt;Writer&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="30px"&gt;&lt;STRONG&gt;Total Projects&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="8.333333333333334%"&gt;&lt;STRONG&gt;Lead&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="8.333333333333334%"&gt;&lt;STRONG&gt;Assistant&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="29px"&gt;Joe&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="29px"&gt;3&lt;/TD&gt;
&lt;TD width="8.333333333333334%"&gt;2&lt;/TD&gt;
&lt;TD width="8.333333333333334%"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="31px"&gt;Mac&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="31px"&gt;1&lt;/TD&gt;
&lt;TD width="8.333333333333334%"&gt;0&lt;/TD&gt;
&lt;TD width="8.333333333333334%"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Maggie&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;Sam&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="30px"&gt;1&lt;/TD&gt;
&lt;TD width="8.333333333333334%"&gt;1&lt;/TD&gt;
&lt;TD width="8.333333333333334%"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is, I have a list of writers in one table who might be represented in either of two columns in the second. For Assistant writer it is a "contains" relationship.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm sure this is a fairly basic thing to do in Base SAS programming but I don't know which proc/statement you would use. I am reasonably sure this cannot be done directly in VA, although I can do some unpleasant workarounds with parameters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am working in a Viya 4 environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any pointers?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Fri, 14 Nov 2025 21:53:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/978881#M11514</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2025-11-14T21:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie data processing question - frequency across two columns?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/978884#M11515</link>
      <description>&lt;P&gt;Are your Have tables already loaded into CAS or are these just normal SAS files and data prep could also happen under Compute?&lt;BR /&gt;What volumes are you dealing with?&lt;/P&gt;
&lt;P&gt;Is your WANT a table or a report?&lt;BR /&gt;&lt;BR /&gt;For creating a table something like below could work. I can't test it but I believe if all your tables are in CAS then the whole process will execute within CAS.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data writer;
  infile datalines truncover dsd dlm='|';
  input writer:$40.;
  datalines;
Joe
Mac
Maggie
Sam
;

data lead_assistant_project;
  infile datalines truncover dsd dlm='|';
  input Lead_Writer:$40. Assistant_Writer:$40. Project:$40.;
  datalines;
Joe|Mac,Maggie|Earwax for Dummies
Joe||Clock Repair
Sam|Joe|Desk Fans: A Celebration
;

/* restructure your data into a form that's easier to work with */
data writer_role_project;
  length writer $40 role $10;
  set lead_assistant_project;
  keep writer role project;
  
  role='Lead';
  do i=0 to countc(Lead_Writer,',');
    writer=scan(Lead_Writer,i+1,',');
    if not missing(writer) then output;
  end;
 
  role='Assistant';
  do i=0 to countc(Assistant_Writer,',');
    writer=scan(Assistant_Writer,i+1,',');
    if not missing(writer) then output;
  end;
 
run;

proc fedsql;
/*   create table want as */
  select 
    coalesce(t1.writer,t2.writer) as writer
    ,sum(case when t1.project='' then 0 else 1 end) as Total_Projects
    ,sum(case when t1.role='Lead' then 1 else 0 end) as Lead
    ,sum(case when t1.role='Assistant' then 1 else 0 end) as Assistant
  from writer_role_project t1
  full join writer t2 
    on t1.writer=t2.writer
  group by coalesce(t1.writer,t2.writer)
  ;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 15 Nov 2025 00:48:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/978884#M11515</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2025-11-15T00:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie data processing question - frequency across two columns?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/978886#M11516</link>
      <description>&lt;P&gt;You could do this, though seems very complicated for what you're ultimately doing (mostly because of the data structure, where variables contain, potentially, lists of delimited names).&amp;nbsp; This assumes one row per project and none with missing lead writer.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
infile cards dsd truncover firstobs=1 dlm="|";
length _lead _assistant project $200;
input _lead _assistant project;
cards;
Joe|Mac, Maggie|A
Joe||B
Sam|Joe|C
;
run;

proc sql noprint;
select count(_assistant) + countc(_assistant, ",") into :nassist trimmed from have;
select count(_lead) + countc(_lead, ",") into :nlead trimmed from have;
quit;

%put &amp;amp;=nassist;
%put &amp;amp;=nlead;

data want;
set have end=last;
array l {&amp;amp;nlead} $50 _temporary_;
array a {&amp;amp;nassist} $50 _temporary_;
array names {%eval(&amp;amp;nlead+&amp;amp;nassist)} $50 _temporary_;
_lead=compress(_lead);
_assistant=compress(_assistant);
nl=countW(_lead, ",");
na=countW(_assistant, ",");
retain tot_l 0 tot_a 0 namenum 0;
do i=1 to nl;
	tot_l+1;
	nm=scan(_lead, i, ',');
	if nm not in names then do;
		namenum+1;
		names[namenum]=nm;
	end;
	l[tot_l]=nm;
end;
if missing(_assistant) then goto next;
do i=1 to na;
	tot_a+1;
	nm=scan(_assistant, i, ',');
	if nm not in names then do;
		namenum+1;
		names[namenum]=nm;
	end;
	a[tot_a]=nm;
end;
next:
if last then do;
	length writer $50 total_proj lead assistant 4;
	do nn=1 to namenum;
		lead=0; assistant=0;
		writer=names[nn];
		do i=1 to tot_l;
			if l[i]=writer then lead+1;
		end;
		do i=1 to tot_a;
			if a[i]=writer then assistant+1;
		end;
		total_proj=sum(lead, assistant);
		output;
	end;
end;
keep writer total_proj lead assistant;
run;

proc print data=want; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="quickbluefish_0-1763165232184.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111305i5A9D979610CAB7BA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="quickbluefish_0-1763165232184.png" alt="quickbluefish_0-1763165232184.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Nov 2025 00:08:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/978886#M11516</guid>
      <dc:creator>quickbluefish</dc:creator>
      <dc:date>2025-11-15T00:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie data processing question - frequency across two columns?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/978888#M11517</link>
      <description>&lt;P&gt;It will easier if you first put the data into a better form.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First let's convert your listing/report into a dataset so we have something to code with.&amp;nbsp; Let's give the variables actual names instead of just labels so the coding will be easier.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  infile cards dsd dlm='|' truncover;
  input lead :$20. assist :$100. Project :$30.;
datalines;
Joe|Mac, Maggie|Earwax for Dummies
Joe| |Clock Repair
Sam|Joe|Desk Fans: A Celebration
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now let's convert it into a "tall" or "long" structure so we do not have multiple data points stored in one instance of a variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fixed;
  projno+1;
  length name $20 role $8 ;
  set have;
  role='lead';
  do _n_=1 by 1;
    name=left(scan(lead,_n_,','));
    if name=' ' then leave;
    output;
  end;
  role='assist';
  do _n_=1 by 1;
    name=left(scan(assist,_n_,','));
    if name=' ' then leave;
    output;
  end;
  drop lead assist ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now we have data like this:&lt;/P&gt;
&lt;PRE&gt; projno    name       role     Project

    1      Joe       lead      Earwax for Dummies
    1      Mac       assist    Earwax for Dummies
    1      Maggie    assist    Earwax for Dummies
    2      Joe       lead      Clock Repair
    3      Sam       lead      Desk Fans: A Celebration
    3      Joe       assist    Desk Fans: A Celebration&lt;/PRE&gt;
&lt;P&gt;From which it will be very easy to get counts.&lt;/P&gt;
&lt;P&gt;For example you could just plain old PROC FREQ.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=fixed;
  tables name*role ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1763174677662.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111306i8517D6253CA9DD47/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1763174677662.png" alt="Tom_0-1763174677662.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Nov 2025 02:44:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/978888#M11517</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-11-15T02:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie data processing question - frequency across two columns?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/978893#M11518</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data writer;
  infile datalines truncover dsd dlm='|';
  input writer:$40.;
  datalines;
Joe
Mac
Maggie
Sam
;

data lead_assistant_project;
  infile datalines truncover dsd dlm='|';
  input Lead_Writer:$40. Assistant_Writer:$40. Project:$40.;
  datalines;
Joe|Mac,Maggie|Earwax for Dummies
Joe||Clock Repair
Sam|Joe|Desk Fans: A Celebration
;

data have;
set lead_assistant_project(rename=(Assistant_Writer=_Assistant_Writer));
length Assistant_Writer $ 80;
if not missing(_Assistant_Writer) then do;
do i=1 to countw(_Assistant_Writer,',');
 id+1;
 Assistant_Writer=scan(_Assistant_Writer,i,',');
 output;
end;
end;
else do;id+1;output;end;
drop _Assistant_Writer i;
run;
proc transpose data=have out=temp;
by id Project;
var Lead_Writer Assistant_Writer ;
run;

proc sql;
create table want as
select a.writer,coalesce(Total_Projects,0) as Total_Projects,
 coalesce(Lead,0) as Lead,coalesce(Assistant,0) as Assistant
 from writer as a left join (

select col1,count(distinct Project) as Total_Projects,
 (select count(distinct Project) from temp where col1=a.col1 and _NAME_='Lead_Writer') as Lead,
 (select count(distinct Project) from temp where col1=a.col1 and _NAME_='Assistant_Writer') as Assistant
 from temp as a
  where col1 is not missing
   group by col1 

) as b on a.writer=b.col1;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1763179486641.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111307iA5FEE69092DBB31C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1763179486641.png" alt="Ksharp_0-1763179486641.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Nov 2025 04:04:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/978893#M11518</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-11-15T04:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie data processing question - frequency across two columns?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/978903#M11519</link>
      <description>&lt;P&gt;You can do it in one DATA step by using a hash object:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data lead_assistant_project;
  infile datalines truncover dsd dlm='|';
  input Lead_Writer:$8. Assistant_Writer:$40. Project:$40.;
  datalines;
Joe|Mac,Maggie|Earwax for Dummies
Joe||Clock Repair
Sam|Joe|Desk Fans: A Celebration
;

data _null_;
set lead_assistant_project end=done;
if _n_ = 1
then do;
  length
    writer $8
    total lead assistant 8
  ;
  declare hash w (ordered:"yes");
  w.definekey("writer");
  w.definedata("writer","total","lead","assistant");
  w.definedone();
end;
writer = lead_writer;
if w.find() = 0
then do;
  total + 1;
  lead + 1;
  rc = w.replace();
end;
else do;
  total = 1;
  lead = 1;
  assistant = 0;
  rc = w.add();
end;
if assistant_writer ne "" then do i = 1 to countw(assistant_writer,",");
  writer = scan(assistant_writer,i,",");
  if w.find() = 0
  then do;
    total + 1;
    assistant + 1;
    rc = w.replace();
  end;
  else do;
    total = 1;
    lead = 0;
    assistant = 1;
    rc = w.add();
  end;
end;
if done then rc = w.output(dataset:"want");
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 16 Nov 2025 08:25:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/978903#M11519</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2025-11-16T08:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie data processing question - frequency across two columns?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/978907#M11520</link>
      <description>&lt;P&gt;Perhaps an overview of the process for our self-admitted newbie&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13794"&gt;@Sam_SAS&lt;/a&gt;&amp;nbsp;might be helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Arranging the data properly so you can actually perform the next analysis is a very important step, and one that beginners sometimes do not grasp. The best arrangement of the data is the "long" or "tall" data set as described by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;. Why is that the best? Because most SAS data analysis PROCs work best on data in this "long" or "tall" arrangement. So once you have this "long" or "tall" data set, a simple call to PROC FREQ (or other relevant PROC) gets the job done.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, the actual process of re-arranging such data isn't particularly simple, especially for newbies, and you have received several examples of working code. But this process of re-arranging the data into "long" or "tall" data sets is where you must start.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: there are of course examples where a "wide" dataset (rather than "long" or "tall") is required, but these are rare, and unless you have a solid justification for "wide" data sets, it is best to avoid them. See &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068" target="_self"&gt;Maxim 19&lt;/A&gt;. Also note that when I talk about a "solid justification for wide data sets", this does not include situations where you want a wide output such as a wide report or wide Excel file; this is not a "solid justification for wide data sets". Wide outputs such as a wide report are wide Excel file are most easily produced from "tall" or "long" data sets via PROC REPORT or PROC TABULATE.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Nov 2025 12:05:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/978907#M11520</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-11-16T12:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie data processing question - frequency across two columns?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/978959#M11521</link>
      <description>&lt;P&gt;Thanks for all the replies!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This data is in xlsx files that are being loaded into CAS by a Viya job.&amp;nbsp; The tables are not "big data" but I think the All Writers table would be about 75 rows and the other one might be ~1,000 rows. Some individuals in the All Writers table might have 0 projects in a given month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not well versed in how to play with CAS data in Studio although I understand it is possible. I want this processing to be able to run as a scheduled job, so I'm not sure if it would be preferable to do this on the tables before they are loaded into CAS, or if it's fine to do it in CAS. I *think* I have the necessary permissions to do either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The end goal is to get a table that is easy to read for a 'dashboard' report in VA.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Nov 2025 16:37:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/978959#M11521</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2025-11-17T16:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie data processing question - frequency across two columns?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/978998#M11522</link>
      <description>&lt;P&gt;In my opinion CAS is not really the place for data prep and though if it was me, I'd use Compute to read the Excel files and prepare a table that's suitable for VA. It's then this table that I'd load into CAS for VA reporting.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can create such a process using SAS Studio flow and then schedule the flow.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You also need to look up/skill up how to define your CAS based reporting data so the VA report autoloads the data into CAS after server restart (which will wipe-out all CAS memory based tables).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you already try to adopt any of the proposed solutions to your environment? If not then that's what you eventually should be doing next so you can ask targeted follow-up questions if you get stuck.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Nov 2025 08:39:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/978998#M11522</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2025-11-18T08:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie data processing question - frequency across two columns?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/979012#M11523</link>
      <description>&lt;P&gt;I think all of the responses could be marked as the solution. Thanks everyone!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ultimately&amp;nbsp; what made the most sense was just to have my data admin create the table with a different query. So I have what I wanted out of the box now.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Nov 2025 13:54:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Newbie-data-processing-question-frequency-across-two-columns/m-p/979012#M11523</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2025-11-18T13:54:41Z</dc:date>
    </item>
  </channel>
</rss>

