Can you show what a version of the HTTP syntax would look like with NO MACRO VARIABLES that would work for multiple ID values?
If you haven't done that already that is the first step for a "combined" file.
You would have to make one Fileref for each value to get separate files.
So instead of
filename out "C:\file.json";
You would create out1, out2, out3 etc each pointing to a different file: C:\file1.json, C:\file2.json, C:\file3.json
Which could be done by moving the Filename into the macro variable loop. Something like:
If you haven't seen something like this with the two dots in the file name the first dot tells SAS that is the end of the macro variable name so the remaining ".json" is appended to the string.
%macro APILoop();
%do index = 1 %to &varCount;
filename out&index. "C:\file&index..json";
%let token = 1a2b3c;
proc http
url="url"
method="get"
out=out&index.
query=("api_key"="&token" "id"="&&varVal&index.");
run;
%end;
%mend;
... View more