Hi everyone,
I have a stored format.
proc format library=RECEIVE.DSTERM_DSDECOD ;
value DSTERM 1='Adverse Event'
2='Protocol Nonompliance'
3='Lost to followup'
4='Investigator decision'
5='patient Withdrawn consent'
6='Death'
7='Ineligible'
8='Other';
run;
i would like to assign the character parts of this format to a new variable name DSDECOD but with UPPERCASE.
I was thinking bout using upcase(), but don't know how to assign the character values to the DSDECOD variable.
Is there any other efficient way out. Kindly help.
Try DSDECOD = upcase(put(var, DSTERM.);
Try DSDECOD = upcase(put(var, DSTERM.);
If you are going to do this frequently you might consider building another format and use the one you need depending on the specific situation:
proc format library=RECEIVE.DSTERM_DSDECOD ; value DSTERMUP 1='ADVERSE EVENT' 2='PROTOCOL NONOMPLIANCE' 3='LOST TO FOLLOWUP' 4='INVESTIGATOR DECISION' 5='PATIENT WITHDRAWN CONSENT' 6='DEATH' 7='INELIGIBLE' 8='OTHER'; run;
Notice the name of the format ends in UP to differentiate the values.
Some of my variables I have multiple formats for different uses. Such as having acronym, short and long text versions.
BTW is "Nonompliance" supposed to be "Noncompliance"?
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!
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.