<?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: programming help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/417438#M102538</link>
    <description>&lt;P&gt;PS example data in usable form:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data proj;
infile cards dlm='09'x;
input project_id emp_name $ role :$10.;
cards;
111	AA	Emp_role1
111	BB	Emp_role2
111	CC	Emp_role3
111	DD	Emp_role4
222	DDD	Emp_role3
222	EEE	Emp_role4
333	AA	Emp_role5
;
run;

data manag;
infile cards dlm='09'x;
input emp_name $ manager $;
cards;
AA	Manager1
BB	Manager1
CC	Manager1
DD	Manager1
EE	Manager5
FF	Manager5
EEE	Manager2
FFF	Manager2
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 30 Nov 2017 15:42:43 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-11-30T15:42:43Z</dc:date>
    <item>
      <title>programming help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/417420#M102530</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking for help in the following scenario,&lt;/P&gt;&lt;P&gt;I have two tables, one with&amp;nbsp;project details like project id, employee_name and employe_role and the other with employee name and manager, mock data is below.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;111&lt;/TD&gt;&lt;TD&gt;AA&lt;/TD&gt;&lt;TD&gt;Emp_role1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;111&lt;/TD&gt;&lt;TD&gt;BB&lt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;EEE&lt;/TD&gt;&lt;TD&gt;Manager2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;FFF&lt;/TD&gt;&lt;TD&gt;Manager2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted to compare and check if all the employees under the same project id have same manager.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Additional Notes:&amp;nbsp;&lt;/STRONG&gt;Each employee&amp;nbsp;can hold&amp;nbsp;different roles in different projects but employee_name and employee_role pair is unique for each project. For example, one person named Chris cannot be a manager and a developer, hence only those employee names in the unique employee, role pairs of each project will be used to compare their managers against.&lt;/P&gt;&lt;P&gt;Let me know if you need further details.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;AC&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 15:14:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/417420#M102530</guid>
      <dc:creator>NewbieSAS23</dc:creator>
      <dc:date>2017-11-30T15:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: programming help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/417426#M102533</link>
      <description>&lt;P&gt;Not sure how the data relates.&amp;nbsp; Only actual duplication is in AA, but that appears in different project.&amp;nbsp; Therefore nothing fulfills your criteria.&amp;nbsp; Show what your output should look like, maybe that will make it clearer.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 15:31:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/417426#M102533</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-30T15:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: programming help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/417432#M102535</link>
      <description>&lt;P&gt;Thank you for the reply. The output should say the "project_id say 111 have all the employees working under same manager". If you see the data. Employee AA, BB, CC and DD of project table, under the project 111 have the same manager, manager1 in the table 2. Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 15:37:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/417432#M102535</guid>
      <dc:creator>NewbieSAS23</dc:creator>
      <dc:date>2017-11-30T15:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: programming help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/417433#M102536</link>
      <description>&lt;P&gt;Data /proc step method:&lt;/P&gt;
&lt;P&gt;Sort both datasets by employee name, and merge them. After that, do a proc sort nodupkey of the resulting table by project id and manager. Now you can run a proc freq or summary by project id to see if a project gets a count &amp;gt; 1.&lt;/P&gt;
&lt;P&gt;SQL method:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table endresult as
select project_id, manager, count(*) as manag_count
from (
  select distinct a.project_id, b.manager
  from proj a left join manag b
  on a.emp_name = b.emp_name
)
group by project_id;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that in your example, DDD does not have a manager.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 15:37:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/417433#M102536</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-11-30T15:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: programming help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/417438#M102538</link>
      <description>&lt;P&gt;PS example data in usable form:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data proj;
infile cards dlm='09'x;
input project_id emp_name $ role :$10.;
cards;
111	AA	Emp_role1
111	BB	Emp_role2
111	CC	Emp_role3
111	DD	Emp_role4
222	DDD	Emp_role3
222	EEE	Emp_role4
333	AA	Emp_role5
;
run;

data manag;
infile cards dlm='09'x;
input emp_name $ manager $;
cards;
AA	Manager1
BB	Manager1
CC	Manager1
DD	Manager1
EE	Manager5
FF	Manager5
EEE	Manager2
FFF	Manager2
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Nov 2017 15:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/417438#M102538</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-11-30T15:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: programming help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/417454#M102543</link>
      <description>&lt;P&gt;Thank you, appreciate the help!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 16:02:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/417454#M102543</guid>
      <dc:creator>NewbieSAS23</dc:creator>
      <dc:date>2017-11-30T16:02:49Z</dc:date>
    </item>
  </channel>
</rss>

