BookmarkSubscribeRSS Feed
Q1983
Lapis Lazuli | Level 10

I am attempting to perform a proc export on 4 datasets  Sas is generating an syntax error based on the outfile.  I am not sure what is wrong wit the syntax here.

Macro Export (Dataset,Sheetname);

proc export data=&Dataset.

             outfile=&Outfile.

            dbms=EXCELCS replace;

                sheet=&Sheetname.;

            server='XX22544';

run;

%Mend;

%Export (Summary_Yr_Total,"Yr_Total");

%Export (Summary_Yr_Risk_Port,"Yr_Risk_Port");

%Export (Summary_Inv_DQ,"Inv_DQ");

%Export (Actives_Curr_Yr_Pl_5_Yrs,"Loan List");

SYMBOLGEN:  Macro variable DATASET resolves to Summary_Yr_Total

NOTE 137-205: Line generated by the invoked macro "EXPORT".

3741     proc export data=&Dataset.              outfile=&Outfile.             dbms=EXCELCS replace;    sheet=&Sheetname.;             server='GA016A744'; run;

                                                         -

                                                         22

ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string. 

1 REPLY 1
Tom
Super User Tom
Super User

You are referencing the macro variable OUTFILE but it is not defined anywhere in the code you posted.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 983 views
  • 0 likes
  • 2 in conversation