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 (December 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 17 Dec 2006 11:11:16 -0500
Reply-To:     Arthur Tabachneck <art297@NETSCAPE.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Arthur Tabachneck <art297@NETSCAPE.NET>
Subject:      Re: Working with several datasets from different dates
Comments: To: z.vika@YAHOO.COM

There are a number of possibilities (e.g., using call execute, a macro, or %include). And, you have decide if the task will be easier as described, or by combining the files and using 'by' processing.

The following is an example using a macro to create one large file in preparation for 'by' processing.

Art

data reserve200612; input x y; cards; 1 2 2 3 ; run; data reserve200611; input x y; cards; 3 4 4 5 ; run; data reserve200610; input x y; cards; 5 6 7 8 ; run; %macro combinethefiles; %do i=200610 %to 200612; data temp; set reserve&i.; date=&i.; run; proc append base=allreservefiles data=WORK.temp; run; %end; %mend; %combinethefiles -------- On Sun, 17 Dec 2006 01:36:21 -0800, z.vika@YAHOO.COM wrote:

>Hi, >lets say I have several files with the same structure but from >different dates. >I would like to run a data steps on each as a loop (without duplicating >the code). >How is it being done? > >PS. file names are reserve200612 reserve 200611 reserve 200610...etc.


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