Hello,
I would like to raise a flag when the texts in 'Description' column are the same and the 'Class' are different. The final result should be at the rows, 1&3&4&5. Thanks.
data dataIN;
infile datalines dsd;
input Class : $50. Department : $100. Description : $100.;
datalines;
ICU,RESPIRATORY THERAPY, VENT OSCILLATOR CIRCUIT
ICU,R&C/NURS UNIT, ROOM & CARE, PEDS ICU
PF, EMERGENCY DEPT, VENT OSCILLATOR CIRCUIT
Room, R&C/NURS UNIT, ED VISIT III
Supply, EMERGENCY DEPT, ED VISIT III
;
I don't understand this. Can you show us your desired result?
I got an email back from Ksharp. His code is working. However, I could not find his message here. Thanks.
proc sql;
create table want as
select * from dataIN
group by Description
having count(distinct Class) >1 ;
quit;
Good catch, @PaigeMiller. I assume that @ybz12003's user interface (like the traditional Display Manager interface that I'm using) reads tabs as spaces so that the unwanted leading tab character in each data line went unnoticed.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: