Date: Fri, 24 Sep 2010 10:52:53 -0400
Reply-To: Dave Brewer <david.brewer@UC.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dave Brewer <david.brewer@UC.EDU>
Subject: Re: PROC FORMAT Anomaly
Excellent explanation...thanks so much.
On Fri, 24 Sep 2010 08:32:24 -0500, Joe Matise <snoopy369@GMAIL.COM> wrote:
>I believe that PROC FREQ etc. will not show [whatever Missing is formatted
>as] without having the /MISSING option, to allow you to do things like
>missing to "MISSING" or whatnot, or to (say) code an 8 as missing in a 1-5
>scale where 8,9 are DK/REF. Add the /MISSING option and you'll see that
>'Invalid' is indeed being used - just not displayed. Since * and n/f N
>being formatted to the same code as ' ', they are considered missing for
>purposes of the PROC FREQ.
>On Fri, Sep 24, 2010 at 8:15 AM, Dave Brewer <firstname.lastname@example.org> wrote:
>> I am having a problem trying to figure out why my user-defined format is
>> not working as expected.
>> proc format ;
>> value $class
>> 'AA000'-'ZZ999' = 'Valid'
>> OTHER = 'Invalid'
>> /* ' ' = 'Missing'*/
>> data x;
>> INFORMAT CLASS $5.;
>> input class $;
>> n/f N
>> proc freq data=x;
>> tables class;
>> format class $class.;
>> I would expect the freq to show 2 Invalid, 3 Valid and 3 missing. When I
>> run the PROC FORMAT as noted above, I get 3 Valid and 5 missing;
>> the line and I get the expected results.
>> Can someone explain why this is? Also, how do I code my FORMAT statement
>> to have code the missing as invalid or some other verbage?