Date: Fri, 26 Nov 2010 10:53:55 -0800
Reply-To: "Jack F. Hamilton" <jfh@STANFORDALUMNI.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Jack F. Hamilton" <jfh@STANFORDALUMNI.ORG>
Subject: Re: percent2.
Content-Type: text/plain; charset=us-ascii
It doesn't work because the PERCENT format requires a minimum width of 4, as shown in the documentation.
It doesn't matter whether you can actually fit the number into the space - what matters is how the format is defined.
You can write your own format with different width restrictions using PROC FORMAT.
On Nov 26, 2010, at 9:23 , bbser2009 wrote:
> I was trying to run the code below, but ended up getting this error: Format
> PERCENT specified with width out of range.
> I do not quite understand this. I can use the informat percent2. for 2%, but
> it is wrong to use the format percent2. to output 2%?
> Any comments, please? Thanks. Max
> data temp;
> input x percent2.;
> proc print;
> format x percent2.;