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

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.

1 ACCEPTED SOLUTION

Accepted Solutions
SandorSzalma
Fluorite | Level 6

Hi,

would you test from your unix server whether you can reach the host?

$ ping host

$ telnet host 81

Regards,

Sándor

View solution in original post

5 REPLIES 5
RichardinOz
Quartz | Level 8

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:

http://hostname/file

http://hostname:portno/file

Richard in Oz

NN
Quartz | Level 8 NN
Quartz | Level 8

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.

RichardinOz
Quartz | Level 8

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

SandorSzalma
Fluorite | Level 6

Hi,

would you test from your unix server whether you can reach the host?

$ ping host

$ telnet host 81

Regards,

Sándor

NN
Quartz | Level 8 NN
Quartz | Level 8

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..

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 5 replies
  • 3725 views
  • 0 likes
  • 3 in conversation