Question

I have a report need to send other sharedrive, need to send title and the date. How can I do that

     PROC EXPORT DATA= WORK.ARG_REPORT
        OUTFILE= "/dwdata/sas_data/REPORT.csv" REPLACE;

  RUN;

what can i add to REPORT for see the date? thaks

Was it helpful?

Solution

You need to create a macro variable with the date especially if the date will change depending on when you run the code. Then reference that variable in the export statement. The code below grabs today's date.

%let numdate = %sysfunc(today(), yymmddn8.);

PROC EXPORT DATA= WORK.ARG_REPORT
            OUTFILE= "/dwdata/sas_data/REPORT_&numdate..csv"  
            DBMS=CSV  REPLACE;
RUN;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top