Hi all,
I am trying to use a filename statement to read the files in a url.
filename myfile url "http://host:81/PATH1/";
When calling this filename i keep getting the error Hostname not found.
I am able to access the url via my internet explorer. However my sas version is on a unix platform.
Any suggestions on how do i take this ahead ?
I did try the debug statement but there were not notes for debug.
Hi,
would you test from your unix server whether you can reach the host?
$ ping host
$ telnet host 81
Regards,
Sándor
Is PATH1 the name of the file you are trying to access? If so, try
filename myfile url "http://host:81/PATH1"; (ie without the final /) or if there is an extension (like .html) include that explicitly.
But if not you may need to explicitly name the file. The SAS UNIX documentation states
The URL must be in one of these forms:
Richard in Oz
Hi richard.. the PATH1 is a directory which contains the files that i wish to read and import.
My objective is to list all the files in a url Path and then import required files.
I have tried /PATH1/ and also /PATH1 but still the error remains.
I did try connecting to another host using the same statment and it was working fine there
but somehow the system seems to be unable to identify this host.
From the documentation I would not expect you to be able to access a directory using the URL option. But I do not have access now to a setup I could check this on. You say you have been able to connect to another host with this syntax; maybe there are file or directory permissions which differ.
Another tack I have used in the past is to use an external ls command with the ouput piped to a named text file. You can read the filenames into a table and proceed from there. I have not tried that with a URL but it might be worth examining as an option if other methods fail.
Richard in Oz
Hi,
would you test from your unix server whether you can reach the host?
$ ping host
$ telnet host 81
Regards,
Sándor
Thanks.. i did ping the host.. and used the ip address of the client in the url instead of the Host name... Its working fine now...
Thanks all..
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.