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 (February 2004, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 18 Feb 2004 15:13:55 -0500
Reply-To:     Charles Patridge <charles_s_patridge@PRODIGY.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Charles Patridge <charles_s_patridge@PRODIGY.NET>
Subject:      Re: subtracting one dataset from another
Comments: To: Kerri Rivers <kerrir@PRB.ORG>

Kerri,

Howard is quite correct - just wasn't thinking - arrays would be better than a macro -

Try this -

DATA METRO; input msacmsa v1 v2 v3 v4; cards; 0040 20000 15000 10000 5000 0060 40000 20000 8000 3500 ;

DATA CITY; input msacmsa v1 v2 v3 v4; array numvars (*) v1-v4; do i = 1 to dim(numvars); numvars(i) = -numvars(i); end; drop i; cards; 0040 16000 11000 7300 3500 0060 37000 18700 6900 2750 ;

data suburb; set metro city; run;

proc summary data=suburb nway missing; classes msacmsa; var _numeric_; output out=suburb (drop=_type_ _freq_) sum=; run;

proc print; run;

HTH, Charles Patridge


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