|Date: ||Tue, 27 Oct 2009 15:00:18 -0500|
|Reply-To: ||Joe Matise <snoopy369@GMAIL.COM>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||Joe Matise <snoopy369@GMAIL.COM>|
|Subject: ||Re: Macro Help|
|Content-Type: ||text/plain; charset=ISO-8859-1|
If you want to merge them together, why do you do an export every single
First off, though, you can use file commands to allow you to read multiple
files in (if you have a simple wildcard expression that identifies all of
the files you want), in one datastep:
infile "j:\PAL Raw Data\*.yyy" missover;
input @41 ID 3.
@46 code 1.
@52 (q1-q78) ($1.);
Second, you either need to use PROC APPEND [and skip 'data combo'], or in
your data combo, you should do:
set combo test;
otherwise you aren't appending to combo, you're overwriting it.
But in general, try to use the wildcard option and skip the macro, if you
What's the %end doing there, also? That should cause an error.
On Tue, Oct 27, 2009 at 2:39 PM, Carol Thurman <firstname.lastname@example.org>wrote:
> I need to call in some txt files and then I want to merge (stack) them
> together as one file. I'm trying to figure out a quick way to do this using
> macros. I'm stuck and need help. My log looks good but the csv file is not
> being created. I'm thinking I need a proc append statement. Can someone
> Here's my syntax:
> >>>%macro PAL (P=);
> >>>options mprint;
> >>>filename io 'J:\PAL Raw Data\';
> >>>data PALS;
> >>>infile io (&P.yyy) missover;
> >>>input @41 ID 3. @46 code 1. @52 (q1-q78) ($1.);
> >>>>data combo; set &P;
> >>>>>PROC EXPORT DATA= WORK.combo
> >>>>OUTFILE= "J:\PAL 2009\HS ReliabilityMacro.csv"
> >>>>DBMS=CSV REPLACE;
> /*proc append base=ALLPALS; data=combo;
> %mend PAL;
> %macro PAL (P=201);
> %macro PAL (P=202);
> %macro PAL (P=203);