In my data set, the variable limit_set_period has both values of "Day" and "Daily". I want to change the "Day" values to "Daily" by
replace limit_set_period = "Daily" if limit_set_period = "Day";
but it does not work
any hints? Thanks
You are close, but make sure the length is sufficient, then,
if limit_set_period = "Day" then limit_set_period = "Daily";
You are close, but make sure the length is sufficient, then,
if limit_set_period = "Day" then limit_set_period = "Daily";
It is simply not a legit SAS code.
That's not valid SAS code...is there some reason you think it is?
indeed I have a length issue. I got the new values "Dai" because the length was defined by "Day".
I defined the length by
length limit_set_period $10 ;
before the set statement. I still got "Dai".
Put this statement right after data statement:
data want;
length limit_set_period $10 ;
set have;
blah blah;
run;
Quite possibly the variable has a $3. format associated with it. Add just before the RUN statement:
format limit_set_period;
Would you mind sharing your code?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.