Formats

Accepted Solution Solved
Reply
Contributor
Posts: 26
Accepted Solution

Formats

Good afternoon,

 

I have a VAR which I have applied a format to assigning many observations (100 plus) to a single observation. Think along the lines of- if you live in Washington State you live in the NorthWest. So the trouble I am having is the Northwest is a number 002 and (the short of the long of it is) it is not an option to change the format. Is there a way to apply a second format over the first, after the first has been applied? Is there a different way I should be thinking about this?

 

Thanks for any help,

 

 


Accepted Solutions
Solution
‎02-14-2018 01:26 PM
Super User
Posts: 23,337

Re: Formats


kmj636 wrote:

Good afternoon,

 

I have a VAR which I have applied a format to assigning many observations (100 plus) to a single observation. Think along the lines of- if you live in Washington State you live in the NorthWest. So the trouble I am having is the Northwest is a number 002 and (the short of the long of it is) it is not an option to change the format. Is there a way to apply a second format over the first, after the first has been applied? Is there a different way I should be thinking about this?

 

Thanks for any help,

 

 


Why do you need both values?  Instead you may need to create a new variable that holds what you want.

View solution in original post


All Replies
Solution
‎02-14-2018 01:26 PM
Super User
Posts: 23,337

Re: Formats


kmj636 wrote:

Good afternoon,

 

I have a VAR which I have applied a format to assigning many observations (100 plus) to a single observation. Think along the lines of- if you live in Washington State you live in the NorthWest. So the trouble I am having is the Northwest is a number 002 and (the short of the long of it is) it is not an option to change the format. Is there a way to apply a second format over the first, after the first has been applied? Is there a different way I should be thinking about this?

 

Thanks for any help,

 

 


Why do you need both values?  Instead you may need to create a new variable that holds what you want.

Contributor
Posts: 26

Re: Formats

I think I have found my solution with nested formats but if someone else has a better idea please let me know.

"More than just a Value" http://www2.sas.com/proceedings/sugi26/p018-26.pdf

 

Thanks!

 

Super User
Posts: 23,337

Re: Formats

Nested is usually used for when you want to show different formats for different values, ie numbers less than 0 are shown as 'Less than 0' but everything above is shown as Percent12.2 or something. That didn't quite seem the case with your description, but if it works that's all that matters in the end. 

 

proc format;
value custom_pct
low - 0 = "less than 0"
other = [Percent12.2];
run;
Contributor
Posts: 26

Re: Formats

No I think you are right and your solution seems to be the easiest. I will create a new VAR for the new format and then apply the second format to the new VAR.

 

Thank you for your help! I appreciate it.

Super User
Posts: 13,350

Re: Formats

Some actual example data and desired results might be helpful.

 

For some uses perhaps a multilabel format would work, but only a few procedures will honor multilabel such as Proc Tabulate, Report and Means/Summary.

☑ This topic is solved.

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

Discussion stats
  • 5 replies
  • 180 views
  • 4 likes
  • 3 in conversation