Hello, i want to import Json file, i did it and the program work well, but i want to write it in macro. Instead full_address variable i want to put macro variable &comm.
but when i write it as is, it's not work, i tried different options, but still i didn't get answer.
What i should do? thank you
filename business "&lnk_input2\name.json";
%macro flexdata(data,comm,output);
data &output;
infile &data lrecl=255 truncover scanover;
input @ '"full_address": "' &comm $240.;
&comm=substr(&comm,1,index(&comm,'",')-1);
run;
%mend;
%flexdata(data=business,comm=full_address, output=business2);
I don't see anything explicitly wrong with your code. It is a bit weird to have the filename defined outside the macro? Wouldn't you have to define it for all files then?
Have you tried running your macro with SYMBOLGEN and MPRINT on?
OPTIONS SYMBOLGEN MPRINT;
Also, are you generating any errors in your code that are displayed to the log.
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!
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.