BookmarkSubscribeRSS Feed
ybz12003
Rhodochrosite | Level 12

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
;
4 REPLIES 4
PeterClemmensen
Tourmaline | Level 20

I don't understand this. Can you show us your desired result?

ybz12003
Rhodochrosite | Level 12

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;
PaigeMiller
Diamond | Level 26
Please test your code to provide data, and make sure it is working properly before you create your message. Your code to provide data does not work.
--
Paige Miller
FreelanceReinh
Jade | Level 19

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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 495 views
  • 0 likes
  • 4 in conversation