BookmarkSubscribeRSS Feed
USHAKS
Fluorite | Level 6

data work.resiSorted;
set work.resi;
by ID Career descending Term;
run;

 

I am having many columns in work.resi.

My data get sorted as I wish.

When I want to get the 1st ID/career/Term details of the observation:-  it is not working;

 

 

proc sort data= work.resisorted;

by ID;

if first.id;

 

3 REPLIES 3
novinosrin
Tourmaline | Level 20

Hi @USHAKS  Do you mean you are after this by any chance

proc sort data=work.resi out=resi_sorted;
by id career descending term;
run;


data work.want;
set work.resi_sorted;
by ID ;
if first.id;
run;
novinosrin
Tourmaline | Level 20

Okay good, I'm glad we figured the need. Thanks!

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
  • 3 replies
  • 287 views
  • 1 like
  • 2 in conversation