I have dataset with patients' IDs numbered in no sequential way. I want to make change to all the IDs.
For example patient 002 would be after the change: F1-1-KIDN-002.
It is just adding "F1-1-KIDN-" in front of the original ID.
I give an example of how the data looks like.
Thank you
id,C1,C2,C3,C4
002,4.19855,5.74574,33.46678,6.85391
007,3.48004,6.69138,31.85662,11.73753
009,3.33851,5.74293,36.09064,10.9801
020,3.2966,8.15718,30.27008,7.62836
data want;
set have (rename=(id=_id));
length id $13;
id = "F1-1-KIDN-" !! put(_id,z3.);
drop _id;
run;
Is id currently stored as numeric or character?
Posting example data in a data step with datalines would have made this question unnecessary.
Numeric
data want;
set have (rename=(id=_id));
length id $13;
id = "F1-1-KIDN-" !! put(_id,z3.);
drop _id;
run;
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.