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. 🙂

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1604 views
  • 2 likes
  • 3 in conversation