The SAS Output Delivery System and reporting techniques

ERROR: File Name value exceeds maximum length of 201 characters.

Reply
Frequent Contributor
Posts: 89

ERROR: File Name value exceeds maximum length of 201 characters.

Hi,

My Proc Export is giving following error message:

ERROR: File Name value exceeds maximum length of 201 characters.

My file path + name are 224 characters long.

I was looking in to other posts regarding this and looks like its a Windows limitation.

But I couldn't find any work around. All posts only discussed problem and claims Windows a bad guy for this limitation.

But what's the solution? How we really deal with it?

PS: I'm using SAS 9.4 installed on Windows Server 2012 R2.

Frequent Contributor
Posts: 89

Re: ERROR: File Name value exceeds maximum length of 201 characters.

Btw I noticed SAS doesn't understand the path if we map part of that to a letter.

So this trick is not helpful.

Valued Guide
Posts: 3,208

Re: ERROR: File Name value exceeds maximum length of 201 characters.

You could also ask the question why in ....name you are wanting that looooooooooooooong names. Can you remember those and type the names.

Than simplifying the naming can help. An oter option could be using a link (link command) for shortening the name, But when it the physical storage convention that will not help. 

---->-- ja karman --<-----
Respected Advisor
Posts: 3,777

Re: ERROR: File Name value exceeds maximum length of 201 characters.

Try using a fileref.

filename FT55F001 'path\name.ext';

proc export outfile=FT55F001 <the rest>;

Occasional Learner
Posts: 1

Re: ERROR: File Name value exceeds maximum length of 201 characters.

Thanks!  Using a fileref worked for me (SAS 9.4, Windows Server 2012R2)!

 

-Bill

Super User
Posts: 6,936

Re: ERROR: File Name value exceeds maximum length of 201 characters.

Operating systems have a limit on filename length. Why? Because they have to reserve that space for filenames in directory files. Allowing arbitrary lengths either cause directories to be harder to handle (no direct indexing possible because of variable lengths) or blow them up considerably in size (causing every access to be slower when the long directory file needs to be read).

SAS itself introduced a limit that was chosen so that it would work on all supported systems.

While PROC EXPORT is platform-independent, the FILENAME statement is part of the SAS system's support for the respective operating system (that's why you find it documented in the Companion for your OS) and is not platform-independent. That is why it can make use of the OS's limitations instead of global limitations.

Use a fileref, but be aware of the Windows limits. And do yourself a favor by making path- and filenames shorter and more readable (and typeable!).

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 5 replies
  • 3474 views
  • 1 like
  • 5 in conversation