BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Junyong
Pyrite | Level 9

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
AhmedAl_Attar
Ammonite | Level 13

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

View solution in original post

2 REPLIES 2
AhmedAl_Attar
Ammonite | Level 13

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

Peter_C
Rhodochrosite | Level 12
Have a look at uses of the infile / file option DEVICE=

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1071 views
  • 0 likes
  • 3 in conversation