LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (October 2001, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 22 Oct 2001 09:37:58 -0400
Reply-To:     "Fehd, Ronald J." <rjf2@CDC.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Fehd, Ronald J." <rjf2@CDC.GOV>
Subject:      Re: Appending all the datasets in one library to all the datasets
              in another
Comments: To: Kendall Golladay <kgollada@UI.URBAN.ORG>
Content-Type: text/plain

> From: Kendall Golladay [mailto:kgollada@UI.URBAN.ORG] > I was wondering if anyone knew of a quick way to append all > the datasets in > one library to all those in another library (to the datasets in this > library with the same names). I am trying to develop a > program that will > process monthly data updates and then add the updates to > existing files. > If there are any other suggestions for performing an > operation like this, please let me know.

ah, yes, list processing, one of my favorite passtimes: writing SAS programs that write my SAS programs for me.

the basic module you want to replicate is: proc APPEND base = LIBOLD.DATA1 data = LIBNEW.DATA1;

you can get a list of MemNames from DICTIONARY.TABLES while you're at it, add the module phrases and save the list into a macro variable:

proc SQL; select 'proc APPEND base = LIBOLD.' !! trim(MemName) !! 'data = LIBNEW.' !! trim(MemName) !! ';' into :LIST separated by ' ' from DICTIONARY.TABLES where MemType = 'DATA' and Libname = 'LIBOLD' ;

Your APPEND module will be in the macro variable LIST which you can view with the %put statement: %PUT LIST<&LIST.>; when you have LIST written with correct syntax, execute it: &LIST.

viole`

Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov OpSys: Win_Pro Ver: 8.2 ---> cheerful provider of semi-TESTED SAS code from the KludgeWrx !*! <---

If you always try to be logical, you probably won't ever have much sorrow, or much fun. -- Ashleigh Brilliant pot-shot #4438


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