Quantcast
Channel: Statistics Help @ Talk Stats Forum - SAS
Viewing all articles
Browse latest Browse all 310

Export certain datasets as csv from macro

$
0
0
Hi

I have a functioning macro that creates a list of datasets from a master file that is unique for each day. The datasets I create in the SAS macro therefore have the data added to them so they are easy to categorize.

I would like to export some of the datasets as I create during the macro as csv files, as this will make analysis in R easier. I have written a Proc Export for each file I would like to export inside the macro itself, however even with the REPLACE function taken out, only the last file of the macro's run is saved to the file destination.

I use the below code for each dataset I would like to export while the macro is running.

Whould I write the proc export statements as individual macros instead?

Code:

PROC EXPORT DATA= dataset&year&mon2&day2

            OUTFILE= "D:\Data"
            DBMS=CSV LABEL;
    PUTNAMES=YES;
RUN;

Thanks

Viewing all articles
Browse latest Browse all 310