Search code examples
sassas-macrosas-ods

Not being able to use macro inside ODS


I'm using the following code:

ods package(ProdOutput) open nopf;
ods package(ProdOutput) add file='\\path(...)\20&year.M&month.\file.csv';

ods package(ProdOutput) publish archive
properties(archive_name='File 20&year.M&month..zip'
archive_path='\\path(...)\20&year.M&month.');

ods package(ProdOutput) close;

If I don't use the macro the ods function works just fine, but when I use the macro 20&year.M&month. the system doesn't recognize even though I'm using in other parts of the code and works just fine.


Solution

  • Text within single quotes does not resolve macro variables and functions. Use double-quotes instead:

    ods package(ProdOutput) open nopf;
    ods package(ProdOutput) add file="\\path(...)\20&year.M&month.\file.csv";
    
    ods package(ProdOutput) publish archive
    properties(archive_name="File 20&year.M&month..zip"
    archive_path="\\path(...)\20&year.M&month.");
    
    ods package(ProdOutput) close;