BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Ardaneth
Fluorite | Level 6

Hi there,

 

i want to use the export funtion while doing regression analyses as follows:

 

    ODS TAGSETS.EXCELXP
    file='H:\Bildung_&x._mitAbi.xls'
    STYLE=minimal
    OPTIONS ( Orientation = 'landscape'
    FitToPage = 'yes'
    Pages_FitWidth = '1'
    Pages_FitHeight = '100' );

 

It is part of an big analysis macro. Is there a way that i can tell SAS that the "&x." in "file='H:\Bildung_&x._mitAbi.xls'" is actualy a macro variable? Its going to be a realy big number of regression analyses and i realy dont want to name the files manualy.

 

Best regards,

Tom

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

Your program is nearly fine as is. 

 

Single quotes suppress all macro activity.  Use double quotes instead of single quotes around the file path.

View solution in original post

3 REPLIES 3
Astounding
PROC Star

Your program is nearly fine as is. 

 

Single quotes suppress all macro activity.  Use double quotes instead of single quotes around the file path.

MC1985
Obsidian | Level 7

something like that:

/*1st SOLUTION: using double quote*/
file="H:\Bildung_&x._mitAbi.xls"
    STYLE=minimal
    OPTIONS ( Orientation = 'landscape'
    FitToPage = 'yes'
    Pages_FitWidth = '1'
    Pages_FitHeight = '100' );

/*2nd SOLUTION: resolve the macrovars before*/
%LET X                          =file_xls_name;
%LET FILE_AND_PATH =H:\Bildung_&X._mitAbi.xls;
%PUT &X.;
%PUT &FILE_AND_PATH.;
file="&FILE_AND_PATH."
    STYLE=minimal
    OPTIONS ( Orientation = 'landscape'
    FitToPage = 'yes'
    Pages_FitWidth = '1'
    Pages_FitHeight = '100' );

???

Martino Crippa
Ardaneth
Fluorite | Level 6

Thanks. That was an easy solution, which spares me from a lot of work. 🙂

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!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1519 views
  • 2 likes
  • 3 in conversation