I am just not getting something that should be obvious, so forgive my ignorance.
I have looked:
https://communities.sas.com/t5/SAS-Procedures/macro-variable-resolution-in-pipe/td-p/112978
One would think that after that, I would have the solution, but no matter which combination I try, I'm not getting the right result:
So I want to replace this:
FILENAME _FList PIPE 'dir "c:\Users\...\Study-data\Posts from 20* to 2020-*.XLSX" /b ';with this:
%LET DataDir=c:\Users\...\Study-data\;
FILENAME _FList1 PIPE 'dir &DataDir.Posts from 20* to 2020-*.XLSX /b';But no matter how I try to quote it, I am missing what I am sure is a pretty obvious solution.
Thanks in advance
%LET DataDir=c:\Users\...\Study-data\;
FILENAME _FList1 PIPE "dir ""&DataDir.Posts from 20* to 2020-*.XLSX"" /b";
This is probably macro mistake #1 for macro newbies 🙂 Been there, done that 😉
Whenever you want macro variables to resolve in a string, use double quotes instead of single quotes.
%LET DataDir=c:\Users\...\Study-data\;
FILENAME _FList1 PIPE "dir ""&DataDir.Posts from 20* to 2020-*.XLSX"" /b";
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.