Prev: Exporting Regression Results to Excel
Next: Obtaining canonical discriminant scores using PROC GLM XXXX
From: Arthur Tabachneck on 28 Dec 2009 23:00 Mark, FYI: That same documention states: "You must enclose a formatted value in single or double quotation marks". It then goes on to provide the example you showed where only half of the values were quoted. Upon testing the example on 9.1.3 it works as is and even if you delete ALL of the quotation marks. I think SAS seriously needs to upgrade their documentation staff. Art ------------ On Dec 28, 11:27 am, mkei...(a)WHARTON.UPENN.EDU ("Keintz, H. Mark") wrote: > Art: > > You're second question was: why does a character format > work even when the values-to-be-formatted (e.g. left > side of the equals sign) are not quoted? > > Answer: Because SAS never said otherwise (or at least > doesn't say otherwise now). In fact, if you go to the > proc format documentation (the "Value Statement" section), > you'll see a character format example with unquoted > left-side values. Specifically: > > value $ score > M=Male "(pass)" > F=Female "(pass)"; > > More interestingly, the RIGHT side has a sequence of > quoted and unquoted values. The quotes are needed to > mask the special character "(" from signalling a format > option (but a right paren [)] does NOT need to be masked). > > Apparently quotes are only needed on the right side for > special characters that have meaning to the format > procedure, which in addition to "(", must also include > '-', ',', ';' the quote marks themselves, and probably > some others I haven't investigated. > > But, as a matter of preserving sanity I'll be favoring > quotes on the right side even if I don't need any of > the special characters listed above. > > Regards, > Mark > > > -----Original Message----- > > From: SAS(r) Discussion [mailto:SA...(a)LISTSERV.UGA.EDU] On Behalf Of > > Arthur Tabachneck > > Sent: Monday, December 28, 2009 10:20 AM > > To: SA...(a)LISTSERV.UGA.EDU > > Subject: Re: Can't format names be up to 30 or 31 chars long? > > > Andrew (and anyone else following this thread), > > ... stuff deleted ... > > > >A secondary question is why will the format even work (although it has > > >the same constaints as when written properly) when the characters to > > >be formatted aren't quoted? > > > >i.e., the following also works: > > > >PROC FORMAT; > > >VALUE $EDU > > >A ="<12 Yrs" > > >B ="12 Yrs" > > >C =">12 Yrs" > > >; > > ... more deleted ... > > > > > > > >Art > > >------------ > > >Earlier posts omitted for brevity. Entire thread can be found at: > > >http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0912d&L=sas- > > l&D=1&O=D&F=&S=&P=17728 > > > >or, in short form:http://xrl.us/bgrggf- Hide quoted text - > > - Show quoted text - |