BookmarkSubscribeRSS Feed
Parvathychand
Fluorite | Level 6

Hello,

 In the practice exam i came across this programming question about sorting.

my answer was :

data results.output27a;
set cert.input27;
country=upcase(country);
if country in("US");
run;

proc sort data=output27a;
by state descending postal_code employee_id;
run;

which gave the answer for employee_id in obs 100 is 121030

 

but the correct answer was 120781 which used in code

proc sort data=cert.input27
out=results.output27a(where=(upcase(country)='US'));
  by state descending Postal_Code employee_ID;
run;

 

1 REPLY 1
Astounding
PROC Star

Can't be sure what your question is.  But one fault with your program is that you sort the data set output27a.  But your program doesn't create that data set, it only creates results.output27a.  Just a typo?  Or truly a different data set?

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 599 views
  • 1 like
  • 2 in conversation