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

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 505 views
  • 0 likes
  • 2 in conversation