Date: Tue, 14 Dec 2010 11:32:22 -0800
Reply-To: "Choate, Paul@DDS" <Paul.Choate@DDS.CA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Choate, Paul@DDS" <Paul.Choate@DDS.CA.GOV>
Subject: using SUM() in SQL SELECT - colon operator or variable list
question
In-Reply-To: <201012141852.oBEBl7ci003734@malibu.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"
Dear SQL gearheads....I have a SAS vs SQL functionality question ... I am not having luck with the colon operator or variable range lists in an SQL SELECT.
I wanted to do this
proc sql;
create TABLE FY0910(drop=fymo:) as
select *,
sum(of fymo4--fymo12) as FYTot format=dollar16.2 ... etc.
or
proc sql;
create TABLE FY0910(drop=fymo:) as
select *,
sum(of fymo:) as FYTot format=dollar16.2 ... etc.
but wound up writing it this way:
proc sql;
create TABLE FY0910(drop=fymo:) as
select *,
sum(fymo4,fymo5,fymo6,fymo7,fymo8,fymo9,fymo10,fymo11,fymo12) as FYTot format=dollar16.2 ... etc.
Can I do it a sleazy cheesy easy way? Or am I missing something obvious yet again? I know that sometimes there's a non-standard way around inside SQL like EQT for EQ:.
Thanks
Paul Choate
DDS Data Extraction
(916) 654-2160
|