Date: Fri, 24 Jul 2009 09:24:44 -0400
Reply-To: msz03@albany.edu
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mike Zdeb <msz03@ALBANY.EDU>
Subject: Re: Retrieve value from row #
Content-Type: text/plain;charset=iso-8859-1
hi ... sure ...
data test;
input x : mmddyy10. @@;
datalines;
01/31/2008 12/15/2007 08/03/1999
;
run;
data _null_;
nrec = 3;
set test point=nrec;
call symputx("x3",put(x,date9.));
stop;
run;
%put &x3;
--
Mike Zdeb
U@Albany School of Public Health
One University Place
Rensselaer, New York 12144-3456
P/518-402-6479 F/630-604-1475
> Thank you! In the same data null step, can we have the macro variable &x456
> to be illustrated in its date format? The variable x is a date9. format.
>
> data _null_;
> set data;
> if _n_=456 then do;
> call symput("x456",x);
> stop;
> end;
> run;
> %put(&x456);
>
> The output was
>
> 11696
> :\
>
> On Fri, Jul 24, 2009 at 7:29 AM, Gerhard Hellriegel <
> gerhard.hellriegel@t-online.de> wrote:
>
>> On Fri, 24 Jul 2009 07:14:56 -0500, OR Stats <stats112@GMAIL.COM> wrote:
>>
>> >Hello:
>> >
>> >I would like to retrieve and save as a macro variable, the value for my
>> >variable X in the nth row from mytable. How do I do that?
>> >
>> >Thank you!
>>
>>
>> data _null_;
>> set data;
>> if _n_=456 then do;
>> call symput("x456",x);
>> stop;
>> end;
>> run;
>>
>> Gerhard
>>
>
|