Date: Fri, 2 Mar 2007 16:39:11 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: How to create multiple macros using Into : operator ??
In-Reply-To: <c2192a610703020824h3895e2d4xd7987ce1aca545e0@mail.gmail.com>
Content-Type: text/plain; format=flowed
Because SQL is looking for distinct on teh entire row or when used with a
summary function:
Distinct PTO , ITT
Or PTO , Count( Distinct ITT )
Toby Dunn
To sensible men, every day is a day of reckoning. ~John W. Gardner
The important thing is this: To be able at any moment to sacrifice that
which we are for what we could become. ~Charles DuBois
Don't get your knickers in a knot. Nothing is solved and it just makes you
walk funny. ~Kathryn Carpenter
From: SAS_learner <proccontents@GMAIL.COM>
Reply-To: SAS_learner <proccontents@GMAIL.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: How to create multiple macros using Into : operator ??
Date: Fri, 2 Mar 2007 10:24:27 -0600
Hello guys,
I am trying to rewrite some part of code in sql for example but I don not
get what is wrong with SQL code , by the way in the process of writing code
I have noticed that I can't use distinct in second part of sql statement
like
proc sql ;
select pt , distinct ( itt) .................
quit ;
at this point SAS complains about distinct part why ??
data header;
set derive.header (keep = itt);
where &population = '1';
run;
proc freq data=header noprint;
tables itt / missing out=freq0(keep=itt count );
run;
data _null_;
set freq0;
call symput("tot1",put(count,3.));
call symput("atot1","(N = "||trim(left(put(count,3.)))||")");
run;
%put &tot1 ;
713 proc sql noprint ;
714 select distinct(count(itt)) as itt_t ,
NOTE: SCL source line.
715 "(N= "!!caliculated itt_t !!")"
-----
22
76
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *,
**, +, ',', -, '.', /, <, <=, <>, =, >, >=, ?,
AND, BETWEEN, CONTAINS, EQ, EQT, GE, GET, GT, GTT, LE, LET,
LIKE, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.
ERROR 76-322: Syntax error, statement will be ignored.
716 into : tot1_test ,
717 : atot1_test
718
719 from derive.header
720 where &population = '1' ;
SYMBOLGEN: Macro variable POPULATION resolves to itt
721
722 %put total is &tot1_test ;
SYMBOLGEN: Macro variable TOT1_TEST resolves to 161
total is 161
723 %put total_n is &atot1_test ;
WARNING: Apparent symbolic reference ATOT1_TEST not resolved.
total_n is &atot1_test
724 quit ;
Thanks for help
_________________________________________________________________
Don’t miss your chance to WIN 10 hours of private jet travel from Microsoft®
Office Live http://clk.atdmt.com/MRT/go/mcrssaub0540002499mrt/direct/01/
|