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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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