05-07-2015 01:31 PM
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.
05-07-2015 03:42 PM
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.
05-08-2015 04:40 AM
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!).