Hello
I currently set the value of a file name as %let export_db="E:\data\2020 21\Q2\inst5555.xlsx";
I can set the institution variable as %let export_db="E:\data\2020 21\Q2\inst_&dqInst..xlsx" (where dqinst is set separately) and it works. But I have many different institutions at various periods in their data and I would like to create variables for fiscal year and quarter so I don't have to change all the time but how do I put it together? For example, below doesn't work:
"E:\data\"||&fiscal||"\"||&qtr||"\"||"DAD DQ_&DQInst..xlsx"
Any and all help greatly appreciated.
You don't need || to concatenate macro variables and text. Try this:
"E:\data\&fiscal\&qtr\DAD DQ_&DQInst..xlsx"
Thank you for your responses. Previously, when I wasn't "building from variables", the Excel file would just open up with the name I had created i.e. DAD_DQ_Inst5555.xlsx. But now that I am building the file name from variables I get an error message that "physical file does not exist". Why would that be and how do I correct it? Thanks.
You are correct, Reeza, I was missing a subfolder in the name. Now it works and all is well. Thanks very much.
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.