Help using Base SAS procedures

Override Observation with it's Format

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Override Observation with it's Format

Hello,

Is there a way to override a value with it's format?

For instance if each US state had a code (01 - 50) and I made a format the grouped them by region (Northeast, Southeast, etc.), could I either copy into a new column the format region as a char or make the format the value of the observation instead of the state code?

Thanks in advance.


Accepted Solutions
Solution
‎09-26-2014 05:19 PM
Super User
Posts: 5,424

Re: Override Observation with it's Format

Yes, use the put() function.

Data never sleeps

View solution in original post


All Replies
Solution
‎09-26-2014 05:19 PM
Super User
Posts: 5,424

Re: Override Observation with it's Format

Yes, use the put() function.

Data never sleeps
New Contributor
Posts: 2

Re: Override Observation with it's Format

Makes sense. Thank you.

Super User
Posts: 11,343

Re: Override Observation with it's Format

In a datastep:

Region = put(state,Regionformat.); /* or $Regionformat if character, you didn't specify*/

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 178 views
  • 5 likes
  • 3 in conversation