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
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 save with the early bird rate—just $795!
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.