Date: Wed, 16 Aug 2006 16:33:38 -0400
Reply-To: Joe Whitehurst <joewhitehurst@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Joe Whitehurst <joewhitehurst@GMAIL.COM>
Subject: Re: how to copy the structure of a table instead of data
In-Reply-To: <BAY101-F2112E95ABA1CC4A7A784B9DE4C0@phx.gbl>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
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
>
|