f



Re: Creating an empty SAS data set #7

Yes, "where 1=2" is potentially really bad.  SAS could realize that it's
always false and behave accordingly, but  on the other hand it might
read every record in OLD.  Shouldn't be hard to test if anyone cares,
but given the better alternatives, I don't think I care.



--
JackHamilton@FirstHealth.com
Manager, Technical Development
Metrics Department, First Health
West Sacramento, California USA

Coelum, non animum mutant, qui trans mare currunt.

>>> "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM> 12/28/04 10:47 PM >>>
On Wed, 29 Dec 2004 11:46:52 +0530, Bhavani Shankar
<bhavani.shankar@INDIA.BIRLASOFT.COM> wrote:

>This will solve your problem
>
>Proc Sql;
>       Create table new.table as select * from old.table where 1=2;
>quit;
>

Hi, Bhavani,

Even though your solution works, I don't think it is a good idea to
suggest it. One reason is that sql has a specialized syntax for creating
an empty table from another, as Roy suggests
(http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0412d&L=sas-
l&D=1&O=A&P=36692). Another reason is that your code needs at least two
comments -- one on the use of an always false where clause, "where 1=2"
--
which, IMHO, is a very ugly hack; another on library names "new"
and "old" -- which you assume that they exist.

Just my two cents...

Cheers,
Chang



"MMS <firsthealth.com>" made the following annotations.
------------------------------------------------------------------------------
This message, including any attachments, is intended solely for the use
of the named recipient(s) and may contain confidential and/or
privileged information.  Any unauthorized review, use, disclosure or
distribution of this communication(s) is expressly prohibited.
If you are not the intended recipient, please contact the sender by
reply e-mail and destroy any and all copies of the original message.
Thank you.
==============================================================================
0
JackHamilton (922)
12/29/2004 6:55:22 AM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
560 Views

Similar Articles

[PageSpeed] 51

Reply: