07-02-2012 02:18 PM
I have a url for example
When i open this path on an internet explorer i can see all the .txt files available in this directory. It appears as a complete list with file name, created date etc:
I wish to know using sas can we list out all the files present in this path.
Kindly guide or any references will also help.
07-03-2012 12:26 AM
There is an example in Arthur.T 's paper at SGF2012 (Sometimes One Needs an Option with Unusual Dates) .
The following is a code fragment from his Paper .
This remind me that I haven't see him for a long time at this forum .
%do i=1901 %to 2100;
filename lunar http
format Gregorian_date yymmdd10.;
infile lunar dlm=' ' firstobs=3 truncover expandtabs ;
input Gregorian_date : ?? yymmdd12. lunar_date & $40.
day_of_week : $20. solar_term & $40.;
if not missing(Gregorian_date) then output;
proc append base=dates data=temp; run;
07-04-2012 11:09 AM
I already had a program like above in place ....
But the restriction of this is that we are assuming the Files name to be in a specified format.
My concern was that if the files had random names would i be able to list all these files...
07-04-2012 10:15 PM
Yes. You can extract these file name from you URL firstly, then feed them to a seriers of macro variables and you can input them. Like something:
filename x url 'http://www.hko.gov.hk/gts/time/calendar/text/'; data _null_; infile x length=len; input x $varying200. len; /*Code here to extract the file name you need */ run;