Hello,
I am having difficultly achieving the following objective when given an excel data file. I have started the code below, but cannot produce an output.
Objective using Macros:
From each of the 5 clinics (inst_num) randomly select 5 AML patients, 10 CML patients, 20 ALL patients, and 5 CLL patients (leu_type). If there are less than 5 AML patients then select all of them, if there are less than 10 CML patients then select all of them, if there are less than 20 ALL patients then select all of them, and if there are 5 CLL patients then select all of them.
Then find cross-tabulation of Leu_type and inst_num. Additionally, print final dataset.
Is this a homework assignment? Because this thread works on almost the exact same data and the exact same variable names.
But, you don't need macros to do this. Assign a random number to each group, sort and then take the top 5 (or top 10, or top 20) etc to randomly select.
Is this a homework assignment? Because this thread works on almost the exact same data and the exact same variable names.
But, you don't need macros to do this. Assign a random number to each group, sort and then take the top 5 (or top 10, or top 20) etc to randomly select.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.