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 (April 2009, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 28 Apr 2009 23:40:24 -0700
Reply-To:     Daniel Nordlund <djnordlund@VERIZON.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Daniel Nordlund <djnordlund@VERIZON.NET>
Subject:      Re: How to create a dataset by appending a single (i.e same)
              dataset multiple times.??
In-Reply-To:  <dc485d8d-8e53-4110-834d-fd296a017e67@z23g2000prd.googlegroups.com>
Content-type: text/plain; charset=iso-8859-1

> -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On > Behalf Of pinu > Sent: Tuesday, April 28, 2009 11:25 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: How to create a dataset by appending a single (i.e > same) dataset multiple times.?? > > There is a dataset A as; > id num > 1 11 > 2 22 > 3 33 > Now I want to create a dataset named A which will consists of records > from A appended 100 times. > Sample o/p of Dataset A will be: > 1 11 > 2 22 > 3 33 > 1 11 > 2 22 > 3 33 > .. > .. > .. > .. > Is there any other way than using the set statement and writing A 100 > times after that > e.g. . data A; > set A A A . .... ..................; > run;

You could try something like the following,

data a; input id num; cards; 1 11 2 22 3 33 ; run;

%macro appendN(file,n); %do i = 1 %to &n; proc append base=want data=&file; run; %end; %mend;

%appendN(a,100)

Hope this is helpful,

Dan

Daniel Nordlund Bothell, WA USA


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