🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 05-26-2020 04:22 AM
(3044 views)
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
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
%LET DataDir=c:\Users\...\Study-data\;
FILENAME _FList1 PIPE "dir ""&DataDir.Posts from 20* to 2020-*.XLSX"" /b";
_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug
"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings
SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug
"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings
SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
%LET DataDir=c:\Users\...\Study-data\;
FILENAME _FList1 PIPE "dir ""&DataDir.Posts from 20* to 2020-*.XLSX"" /b";
_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug
"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings
SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug
"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings
SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation