How to mask/hide digit selectors in a picture format

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 17
Accepted Solution

How to mask/hide digit selectors in a picture format

Hi everyone,

I'm having a problem with a picture format that I haven't been able to find a solution to in SAS documentation. I'm using a picture format to format visual acuity values (eg, 20/20 vision, 20/30 vision). This way the value of the variable is the denominator and I can keep it as numeric and sort properly, etc. The code is something like:    

     .....

    input va;

    datalines;

     30

     40

     150

     ; .....

     proc format; picture vaf low-high="0000" (prefix='20/'); run;

The problem comes in when I have a separate category for "Worse than 20/200 vision". This needs to be formatted as such (or similar) BUT when I use the picture format, such as:

proc format;

picture vaf  201-high="Worse than 20/200" low-200="0000" (prefix='20/');

run;

Since it's a picture format, the "20/200" portion of the "worse than 20/200" format is read as digit selectors and I get values like:

   

00/250

00/500

etc.

Is there anyway to mask or hide the "20/200" portion of this format to tell SAS to treat it as a string rather than digit selectors? Any alternative solutions to this formatting issue are also welcome!

Thanks in advance for anyone who can help!

Ashley


Accepted Solutions
Solution
‎04-11-2013 03:50 PM
Super User
Posts: 11,343

Re: How to mask/hide digit selectors in a picture format

Posted in reply to ashlicole

proc format;

picture vaf  201-high="Worse than 20/200" (noedit) low-200="0000" (prefix='20/');

run;

View solution in original post


All Replies
Solution
‎04-11-2013 03:50 PM
Super User
Posts: 11,343

Re: How to mask/hide digit selectors in a picture format

Posted in reply to ashlicole

proc format;

picture vaf  201-high="Worse than 20/200" (noedit) low-200="0000" (prefix='20/');

run;

Occasional Contributor
Posts: 17

Re: How to mask/hide digit selectors in a picture format

Well, don't I feel silly? Thank you so much for this perfect answer!!

🔒 This topic is solved and locked.

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

Discussion stats
  • 2 replies
  • 205 views
  • 0 likes
  • 2 in conversation