BookmarkSubscribeRSS Feed
mediaeval
Calcite | Level 5

I want to pass a parameter to a macro as follows:

%CreateCSVFile(&OutputDirectory || "FD_Summary.csv", 'InputDataset')

This throws an error. I know I can get around it by saying:

Data _Null_;
Informat OutputFile $200.;
OutputFile = &ExperienceOutput || "FD_Summary.csv";
Call Symput('OutputFile',OutputFile);
Run;

%CreateCSVFile(&OutputFile, 'FD_Summary', 1000);

I'd like to avoid the extra data step if I can though. Is this possible?

1 REPLY 1
Reeza
Super User

What about

%createscsvfile(&outputdirectory.FD_summary.csv, inputdataset)

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1110 views
  • 3 likes
  • 2 in conversation