BookmarkSubscribeRSS Feed
Amy0223
Quartz | Level 8

Could someone help me answer these problems? thank you!

 

Instructions: Please write the SAS code you would use to do each of the following tasks.  The library name should be ONE, the datasets should be named DATA1 (with variables ID, AGE, GENDER, and SMOKE) and DATA2 (with variables REDCAP_ID, Q1, Q2, and Q3).

  1. Write a code to import DATA1.csv file to SAS dataset into the library and remove duplicates.
  2. Write a merge code to keep only the records that are common in both datasets.
  3. Write a macro to create frequency report for all variables in the combined SAS dataset with rtf destination.
  4. Write a code to convert the variable AGE, which is currently a character variable, to numeric and recode to create age categories 0-20, 21-40, 41-60, 61-80, and 81-100.
  5. Write a format code and apply it to the above categories.
1 REPLY 1

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1 reply
  • 441 views
  • 0 likes
  • 2 in conversation