Hello ,
I have a data set of multiple dates , and for each data a maturity
the maturities in the data are coded in numbers , for example 2 means 52 weaks , 3 means 2 years , 4 means 5 years ....
I want to recode this variable so that for each number I get the text instead.
Thank you in advance
Use a format:
That is exactly what they are for.
proc format; value tmp 2="52 weeks" 3="2 years"; run; data want; set have; format var1 var2 tmp.; run;
Use a format:
That is exactly what they are for.
proc format; value tmp 2="52 weeks" 3="2 years"; run; data want; set have; format var1 var2 tmp.; run;
Hello and thank you for your fast reply
I'm new to sas , and i'm discovering this functions.
so when I used your code , I got the following error :
28 6="2Y";
_
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
Any clue ?
Thank you
When encountering problems, ALWAYS post the log of the whole step. The cause of the ERROR is further up.
And use the {i} button for posting logs, to conserve content and formatting.
The error tells you the issue, that statement is used incorrectly. So its likely something before that has gone wrong. As you haven't shown the full log however there is no way I can tell. Refer to the code I presented and see what is different with your code, and then post the log here, all relevant log output.
Thank you all for your help .
Have a great day.
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.