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 (August 2007, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 31 Aug 2007 09:37:06 -0400
Reply-To:     Lingqun Liu <lingqun@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Lingqun Liu <lingqun@GMAIL.COM>
Subject:      Re: Merge different months' data
Comments: To: yingtao <yingtaoliu@gmail.com>
In-Reply-To:  <7fae10f00708300855g66abb78dyd1788621ed439603@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Your production code could be:

%macro combine(from,to); data _null_; t_pair = INTCK('month',&from,&to)-1; do pair=0 to t_pair; start=intnx('month',&from,pair); end=intnx('month',&from,pair+1); dsn1='sale'||put(start,yymmn6.); dsn2='nosale'||put(end,yymmn6.); call execute(' data '|| dsn1||'_'||dsn2||'; set '|| dsn1 ||' '||dsn2 ||'; by acc_id; run;' ); end; run; %mend;

%combine('01nov2006'd,'01feb2007'd);


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