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

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

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
  • 1850 views
  • 0 likes
  • 3 in conversation