| Date: | Thu, 30 Jan 2003 17:36:57 -0500 |
| Reply-To: | Mike Rhoads <RHOADSM1@WESTAT.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Mike Rhoads <RHOADSM1@WESTAT.COM> |
| Subject: | Re: right-align in pdf, different # of decimals? |
|
| Content-Type: | text/plain; charset="iso-8859-1" |
|---|
Michael,
Since you want missing to print as NA, I suppose you will need a
user-created format, and you can then nest one or more SAS numeric formats
within it. It may be that Ed Heaton's suggestion of D4.3 (nice catch Ed! I
wasn't aware of that one) will completely meet your needs, but if that
doesn't work for all your values, you could specify different numeric ranges
in your format with the appropriate SAS numeric format spec (desired # of
decimal places) for each.
Good luck (and hi from the old DCSUG crew)!
Mike Rhoads
Westat
RhoadsM1@Westat.com
-----Original Message-----
From: Yu, Michael [mailto:michael.yu@SPCORP.COM]
Sent: Thursday, January 30, 2003 9:40 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: right-align in pdf, different # of decimals?
Problem:
0.12 must be printed 0.12
0.5 must be printed 0.50
1.23 --> 1.23
1.5 --> 1.50
12.378 --> 12.4
12.008 --> 12.0
missing --> NA
so on and so forth.
Don't think I can use numeric variable for this because the # of decimals
varies with magnitude. Am I right?
So I put it into character variable and right shift, like
attrib y length= $ 8;
x= 1.5;
y= put( x, 5.2 );
y= right( y );
Now regular print this Y shows up, right-aligned, as if a normal numeric
variable. But when I send the output to ODS PDF then this "right-aligned"
effect is gone, it looks like regular "left-aligned" characters?!?!???
Workaround suggestions? Thanks
Hsiwei
*********************************************************************
This message and any attachments is solely for the intended recipient. If
you are not the intended recipient, disclosure, copying, use or distribution
of the information included in this message is prohibited -- Please
immediately and permanently delete.
|