| Date: | Fri, 20 Apr 2007 11:05:40 -0700 |
| Reply-To: | "Terjeson, Mark" <Mterjeson@RUSSELL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "Terjeson, Mark" <Mterjeson@RUSSELL.COM> |
| Subject: | Re: Unexpected output |
| In-Reply-To: | A<16FD64291482A34F995D2AF14A5C932C015A729C@MAIL002.prod.ds.russell.com> |
| Content-Type: | text/plain; charset="us-ascii" |
Sorry, I see my fingers didn't type as fast as my thought...
The PUT statement was NOT made to resolve expressions.
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Terjeson, Mark
Sent: Friday, April 20, 2007 10:53 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Unexpected output
Hi Irin,
The PUT statement was made to resolve expressions, so you merely have to
resolve the expression first and then PUT does a good job of outputting
strings and final numbers. Don't forget to quote literal strings and
not quote variables. e.g.
data _null_;
file print;
num1=8;
denom1=2;
x = num1/denom1;
put "Percent=" x " Percent=" x;
run;
Hope this is helpful.
Mark Terjeson
Senior Programmer Analyst, IM&R
Russell Investment Group
Russell
Global Leaders in Multi-Manager Investing
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Irin later
Sent: Friday, April 20, 2007 10:31 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Unexpected output
I am trying to get an output using the following code:
data _null_;
file print;
put "Percent=num1/denom1
Percent=num1/denom1";
...
run;
And I got unexpected output:
Percent=num1/denom1 Percent=num1/denom1
Percent=num2/denom2 Percent=num2/denom2
....
In other words I did not get any numbers.....while my num1; denom1;
num2; den2 are definitely numbers.
What do you think I am doing wrong?
Thank you in advance,
Irin
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
Check outnew cars at Yahoo! Autos.
|