BookmarkSubscribeRSS Feed
coder1234
Obsidian | Level 7

Opportunity for Improvement:

1) Add Proc Sort instructions as part of the instructions.  Just to keep in consistency with the previous Practices/Assignment/Challenges OR  add "When sorting the data, keep only the Region, ParkName, State, and GrossAcres columns." higher up on the list of instructions, instead of after "Write a DATA step..."

 

2) 

Include as an alternative solution for Question 2.

Spoiler
proc freq data=singlestate;
run;

Include as an alternative solution for Question 3. 

Spoiler
proc print data=multistate;
Where upcase(ParkName)= 'HOVENWEEP NM';
run;

 

 

1 REPLY 1
SASJedi
Ammonite | Level 13

Thanks for taking the time to suggest improvements to the final Challenge problem in Lesson 2 of the SAS® Programming 2 course!

Question 2 reads: "How many rows are in the singlestate table?"
I personally feel that adding a PROC FREQ step to the solutions to question 2 is inefficient. The PROC FREQ output itself doesn't provide an easy answer to the question, and if you're using the row count reported in the log for PROC FREQ, it's the same as that reported in the log after the DATA step finished processing - so it's just as easy, and more efficient, to grab it from the DATA step log.


Question 3 reads: "In the multistate table, in which two states does the Hovenweep NM value appear for ParkName?"

And I really like your suggested addition for the question #3 solution. Using PROC PRINT with a WHERE clause is a nice programmatic approach and avoids having to page through the data in the viewer while searching visually for the answer. 

Have fun with the rest of the course!
Mark

Check out my Jedi SAS Tricks for SAS Users

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

LIBNAME 101

Follow along as SAS technical trainer Dominique Weatherspoon expertly answers all your questions about SAS Libraries.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1013 views
  • 0 likes
  • 2 in conversation