Hello I am stuck with Retain values for variable ABLFL
ABLFL value is "Y" where VISITNUM is 10 and 10.1 and i need retain ABLFL values for same PARAMCD by USUBJID
Please provide your data in a SAS program, so we don't have to do this for you
How to convert datasets to data steps
The macro for direct download
Provide the expected output and the logic
provide your SAS code that you are working with.
Help us help you by providing the items needed to answer your request.
What should the result be for paramcd "GGT"? It's only at visit 10.01 that ABLFL is "Y". Do you want that backfilled for visit 10 as well?
Hello
No I don't want back filled the data
It looks like ADT is the variable that can order the observations by date. (If you prefer to use VISITNUM to do this, that's OK.)
Here's a way:
proc sort data=have;
by usubjid paramcd adt;
run;
data want;
update have have (keep=usubjid paramcd ablfl);
by usubjid paramcd;
output;
run;
It's untested code, but should be fine.
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!
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.