'adding alphabet letters for values with a do loop in sas
data test;
length val $15;
input obs val $ pvalue;
cards;
1 demog 0.8812
2 ae 0.7112
3 dispostion 0.8234
4 exposure 0.7788
;
run;
I would like to get a new dataset with pvalue like 0.8812a, 0.7112b, 0.8234c, 0.7788d. The real datasets in my hand are pretty long and following with the alphabet letters such as e, f, g, etc. Could you please help me solve this problem with a do loop in sas?
Thank you so much!
Solution 1:[1]
You should do something like this
data CLASS (drop = _h);
set sasHelp.CLASS(rename =Height = _h);
Heigth = cats(put(_h, 4.2), byte(rank('a') + _N_ - 1));
run;
but what exactly depends on your answers to Tom.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dirk Horsten |
