LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 16 Aug 2006 20:48:39 +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 copy the structure of a table instead of data
Comments:   To: joewhitehurst@GMAIL.COM
In-Reply-To:   <129a50e0608161333r4b9c5960t32f2a22d9ca14601@mail.gmail.com>
Content-Type:   text/plain; format=flowed

Yes Joe I know that, but then again we arent talking about proc append we are talking about copying the meta data to an empty data set. But lets follow this to it conclusion shall we and perhaps you can elaborate a little more.

Lets say I create a empty data set such as Jack suggests. Then add some unsorted data to it with proc append. One the sort order will not be preserved but more importantly will the index file be updated such that the no longer needed entries be deleted and the new ones added, or will it simple keep the old entries and add the new ones. If it is the later then the speed that the index offers may not be.

Toby Dunn

Normal People Worry Me!!!!!

I reject your reality and substitute my own!!!

From: Joe Whitehurst <joewhitehurst@GMAIL.COM> Reply-To: Joe Whitehurst <joewhitehurst@GMAIL.COM> To: SAS-L@LISTSERV.UGA.EDU Subject: Re: how to copy the structure of a table instead of data Date: Wed, 16 Aug 2006 16:33:38 -0400

Toby,

If Proc Append is used to add data, SAS automatically maintains the index.

Joe

On 8/16/06, toby dunn <tobydunn@hotmail.com> wrote: >Jack , > >Lets say we did the following: > >options obs=0; > proc copy in=old out=new index=yes constraint=yes clone; > run; >options obs=max; > > >Would the Index or sort order even be any good any more? Can kind of see >where the sort order could be preserved if and only if you add data to the >newly created data set that was already in the correct sort order. >However, >I cantsee how one could control the index. > > >Toby Dunn > >Normal People Worry Me!!!!! > >I reject your reality and substitute my own!!! > > > > > >From: Jack Hamilton <jfh@STANFORDALUMNI.ORG> >Reply-To: jfh@stanfordalumni.org >To: SAS-L@LISTSERV.UGA.EDU >Subject: Re: how to copy the structure of a table instead of data >Date: Wed, 16 Aug 2006 13:08:35 -0700 > >There are numerous ways to do this, but the one I think is the best is >this (untested code): > > options obs=0; > proc copy in=old out=new index=yes constraint=yes clone; > run; > options obs=max; > >It's simple, and it copies all of the attributes of the data set, >including indexes, constraints, and various data set options. > > > >--- Wensui Liu <liuwensui@GMAIL.COM> wrote: > > > Dear Listers, > > > > Is there any way I can copy the structure of a table? I just need the > > structure and don't want any data in it. > > > > Thanks. > > > > -- > > WenSui Liu > > (http://spaces.msn.com/statcompute/blog) > > Senior Decision Support Analyst > > Health Policy and Clinical Effectiveness > > Cincinnati Children Hospital Medical Center > > > > >--- >Jack Hamilton >Sacramento, California >


Back to: Top of message | Previous page | Main SAS-L page