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 ??
Content-Type: text/plain; format=flowed
Because SQL is looking for distinct on teh entire row or when used with a
Distinct PTO , ITT
Or PTO , Count( Distinct ITT )
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>
Subject: How to create multiple macros using Into : operator ??
Date: Fri, 2 Mar 2007 10:24:27 -0600
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
proc sql ;
select pt , distinct ( itt) .................
at this point SAS complains about distinct part why ??
set derive.header (keep = itt);
where &population = '1';
proc freq data=header noprint;
tables itt / missing out=freq0(keep=itt count );
call symput("atot1","(N = "||trim(left(put(count,3.)))||")");
%put &tot1 ;
713 proc sql noprint ;
714 select distinct(count(itt)) as itt_t ,
NOTE: SCL source line.
715 "(N= "!!caliculated itt_t !!")"
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
719 from derive.header
720 where &population = '1' ;
SYMBOLGEN: Macro variable POPULATION resolves to itt
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/