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 (January 2004, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 15 Jan 2004 09:32:17 -0500
Reply-To:     "Fehd, Ronald J. (PHPPO)" <rjf2@CDC.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Fehd, Ronald J. (PHPPO)" <rjf2@CDC.GOV>
Subject:      Re: Merging multiple datasets
Comments: cc: Dea Talu <deatalu@HOTMAIL.COM>
Content-Type: text/plain; charset="us-ascii"

> From: Dea Talu [mailto:deatalu@HOTMAIL.COM] > Is it possible to merge all these datasets in one data-step? > I am basically trying to improve the efficiency of the > program. Thank you,

yes

data n_4001; do until(EndoFile); merge forecast (in=a) n_4001 n_4002 n_4003 n_4004 n_4005 n_4006 n_4007 n_4008 end = EndoFile; by day; if a then output; end;stop; run;

your next question will be: "How do I get the list of data sets N_* into a macro variable?"

PROC Sql;select Name into :List separated by ' ' from Dictionary.Tables where LibName eq 'WORK' and substr(Name,1,2) eq 'n_' ;quit;

merge forecast (in=a) &List. end = EndoFile;

Ron Fehd the SQL into:macro maven CDC Atlanta GA USA RJF2@cdc.gov keywords: list processing, dynamic coding


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