🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 01-23-2020 10:36 AM
(627 views)
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.
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Have a look at uses of the infile / file option DEVICE=