| Date: | Tue, 4 Oct 2011 11:29:00 -0300 |
| Reply-To: | Adriano Rodrigues <adriano@GPP.COM.BR> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Adriano Rodrigues <adriano@GPP.COM.BR> |
| Subject: | RES: %let ? |
| In-Reply-To: | <FA0550A1D186FF49BB0748CD711B17EDC698887918@SDPSMSX.QUALNET.ORG> |
| Content-Type: | text/plain; charset="iso-8859-1" |
Ty both!
-----Mensagem original-----
De: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] Em nome de Bian,
Haikuo
Enviada em: terça-feira, 4 de outubro de 2011 11:25
Para: SAS-L@LISTSERV.UGA.EDU
Assunto: Re: %let ?
Hi,
There will be more than one approaches. Most two often used as following:
data have;
infile cards;
input p14 COUNT
;
cards;
1 42.55
2 57.45
;
data _null_;
set have;
if p14=1 then call symput ('c1',count);
if p14=2 then call symput ('c2',count);
run;
proc sql;
select count into: c1 from have where p14=1 ;
select count into: c2 from have where p14=2 ;
quit;
%put &c1 &c2;
HTH,
Haikuo
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Adriano
Rodrigues
Sent: Tuesday, October 04, 2011 10:11 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: %let ?
Hi all,
Data have:
Obs p14 COUNT
1 1 42.55
2 2 57.45
Suppose I want use this values for another math's and for print some texts
like:
"the percentage was 42.55"
"you have 57.45 to work"
Suppose I want use this for one multiplication in future also:
" 42.55 x 57.45 is your index number"
How I use the %let to get this values in variables?
I wanted something like this but it not works.:
data xx1;
set have;
if p14=1 then %let c1=count;
if p14=2 then %let c2=count;
run;
and later I could use &c1 and &c2..
Can someone clarify this to me?
Ty in advance,
Adriano
-----------------------------------------
Email messages cannot be guaranteed to be secure or error-free as
transmitted information can be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The
Centers for Medicare & Medicaid Services therefore does not accept
liability for any error or omissions in the contents of this
message, which arise as a result of email transmission.
CONFIDENTIALITY NOTICE: This communication, including any
attachments, may contain confidential information and is intended
only for the individual or entity to which it is addressed. Any
review, dissemination, or copying of this communication by anyone
other than the intended recipient is strictly prohibited. If you
are not the intended recipient, please contact the sender by reply
email and delete and destroy all copies of the original message.
|