Suppose there is a data set with multiple URLs of raw data. Can one feed these paths as FILEVAR in INFILE to read multiple files? Or if impossible can one read multiple URLs using a FILENAME statement as follows?
filename pages url ('https://www.aqr.com/Insights/Datasets?&page=1' 'https://www.aqr.com/Insights/Datasets?&page=2');
It seems FILENAME does not allow this approach, but I wonder if there is any leeway to avoid %MACRO. Thanks for help.
Try this
data _null_;
infile datalines ;
length fil2read $70;
input fil2read $;
infile dummy URL filevar=fil2read end=done;
do while(not done);
input ;
put _infile_;
end;
datalines;
https://www.aqr.com/Insights/Datasets?&page=1
https://www.aqr.com/Insights/Datasets?&page=2
run;
Thanks,
Ahmed
Try this
data _null_;
infile datalines ;
length fil2read $70;
input fil2read $;
infile dummy URL filevar=fil2read end=done;
do while(not done);
input ;
put _infile_;
end;
datalines;
https://www.aqr.com/Insights/Datasets?&page=1
https://www.aqr.com/Insights/Datasets?&page=2
run;
Thanks,
Ahmed
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.