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

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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