- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi all. Say I have a data set with these variables.
ID varA varB varAtext footnote2
1 12 34 12 * means caution in interpreting
I want to add a "*" to varAtext, so it will look like this:
ID varA varB varAtext footnote2
1 12 34 12* * means caution in interpreting
How do I do that?
In the original data set, there was another column, "Interpret_with_caution" and some rows had "YES", so I had code
if Intepret_With_Caution eq "YES" then Footnotes2 = "* means caution in interpreting";
And please, folks, no comments about why do I want to do this, why do I want to use this symbol, why do I use those words about caution, what are the rules for when to interpret with caution, and so on. Please, if you could just give me advise on how to do this, that would be great.
Thanks
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The way you have worded this all you need to do is:
data want;
set have;
varAtext = cats(varAtext,'*');
run;
But I suspect there is something more complex you want to do but have not explained.
So perhaps VARATEXT is not defined long enough to handle the extra character?
Or perhaps there is some condition you need to test before adding the asterisk?
Or perhaps you want to create VARATEXT from VARA?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The way you have worded this all you need to do is:
data want;
set have;
varAtext = cats(varAtext,'*');
run;
But I suspect there is something more complex you want to do but have not explained.
So perhaps VARATEXT is not defined long enough to handle the extra character?
Or perhaps there is some condition you need to test before adding the asterisk?
Or perhaps you want to create VARATEXT from VARA?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content