Date: Mon, 1 Jul 1996 22:47:01 -0700
Reply-To: Karsten Self <kmself@IX.NETCOM.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Karsten Self <kmself@IX.NETCOM.COM>
Subject: Re: question on replicating a dataset
As Ian Whitlock pointed out, a goof in my prior code, corrected below. As
input and output are being explicitly controlled, SAS needs to be told when
to quit. I believe (code is untested), that the result without 'STOP' is an
error saying SAS detected a looping condition.
At 08:29 AM 7/1/96 EDT, email@example.com wrote:
> A STOP on the end of the last step is needed to stop the DATA step.
>Author: Karsten Self <kmself@IX.NETCOM.COM> at internet-e-mail
>Date: 7/1/96 6:16 AM
>SAS gives you several ways to do this, along with most things.
>To replicate a dataset:
> * create some data;
> data x;
> input a b $ c;
> 1 a 10
> 2 b 20
> 3 c 30
> * make a copy;
> data x2;
> set x;
> * make a copy with each input record duplicated
> * in the same order as originally specified.
> * Change the value of 'i' to create the desired
> * number of copies;
> data x3;
> set x;
> do i = 1 to 2;
> drop i;
> * Make a copy where the entire set of records in 'x'
> * is duplicated;
> data x4;
> * we will make two copies. Change this value
> * to make more or fewer copies.
> do iCopy = 1 to 2;
> * Since we are explicitly controlling
> * both input and output, we have to tell
> * the data step how many records to read
> * -- in this case, the entire data set 'x'
> do iObs= 1 to nobs;
> set x nobs= nobs;
stop; /* this was omitted in the original */
> drop iCopy iObs;
>At 08:18 PM 6/30/96 -0500, Niren Sirohi wrote:
Karsten Self / firstname.lastname@example.org
...internet immortality achieved:
What part of gestalt don't you understand?