BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

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.   

1 ACCEPTED SOLUTION

Accepted Solutions
Shmuel
Garnet | Level 18

Try DSDECOD  = upcase(put(var, DSTERM.);

View solution in original post

2 REPLIES 2
Shmuel
Garnet | Level 18

Try DSDECOD  = upcase(put(var, DSTERM.);

ballardw
Super User

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"?

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1219 views
  • 0 likes
  • 3 in conversation