BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Ksharp
Super User

Can you post the OUTPUT you want ?

 

 

data have;
input ID $       JOB   $ as  ;
cards;
A-0-0082 X 25
A-0-0082 Y 25 yes 
A-0-0082 Z 25
A-0-0111 Y 36 no 
A-0-0111 C 36 no
B-0-0012 D 20 no
B-0-0012 Y .  yes
B-0-0012 Y 40 no 
;
run;

data temp;
 set have;
 by id job notsorted;
 group+first.job;
run;
data want;
 set temp;
 by group;
 if last.group and job='Y';
run;
Skillside
Calcite | Level 5

I would like to have something like this:

ID

Job

Age

Diagnosis of ms

VARIABLE N etc.

A-0-0082

Y

25

yes

 

A-0-0111

Y

36

no

 

B-0-0012

Y

40

no

 

Ksharp
Super User

En, So Did you run my code ? Is that what you are looking for ?

Skillside
Calcite | Level 5

Yes, thank you so much!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 18 replies
  • 1274 views
  • 0 likes
  • 4 in conversation