DATA Step, Macro, Functions and more

Importing data from external files

Regular Learner
Posts: 1

Importing data from external files



I'm using SAS 7.1, I'm working in a remote host with SAS but SAS is in a server.

I'm tried to import and append a lot of files into one but, SAS shows that not recognize the path, I see that is because SAS take the path like local path, but the files are in other server. How can I declare that the file is in here ("\\sbmdebns03\VP_SERV_CLIE\DIR_SERV_FINAN\GCIA_SERV_TRIB\InfoActual\2016\TRIBUTARIA CLIENTES\Certificados Anuales\SAS\Proceso Certificados Tributarios\Data\Input\Planos HtaCertificados\RFTE_2010_1\ArchivosGenerados\RFTE2015_1.txt";


For this example I put only two files, but in this moment are 56 files


FILENAME archivos ('\\sbmdebns03\VP_SERV_CLIE\DIR_SERV_FINAN\GCIA_SERV_TRIB\InfoActual\2016\TRIBUTARIA CLIENTES\Certificados Anuales\SAS\Proceso Certificados Tributarios\Data\Input\Planos HtaCertificados\RFTE_2010_1\ArchivosGenerados\RFTE2015_1.txt' '\\sbmdebns03\VP_SERV_CLIE\DIR_SERV_FINAN\GCIA_SERV_TRIB\InfoActual\2016\TRIBUTARIA CLIENTES\Certificados Anuales\SAS\Proceso Certificados Tributarios\Data\Input\Planos HtaCertificados\RFTE_2010_1\ArchivosGenerados\RFTE2015_2.txt');

data temp;
infile archivos;
input A B C D E F G H I J K L M N O P Q R S T U V W;
proc print data = temp;


The numbre of columns are 23 and the error is this:

ERROR: Physical file does not exist,
CLIENTES\Certificados Anuales\SAS\Proceso Certificados Tributarios\Data\Input\Planos


So like I said (/sasend/sas_config/Lev1/SASApp/\) this path is in the server and my files aren't there.


Thank you for you help!

Super User
Posts: 10,280

Re: Importing data from external files

[ Edited ]

Your SAS server obviously resides on a UNIX platform, so you have to use UNIX filename syntax:

- directories are separated by a forward slash instead of a backslash

- directory names should start with a slash, indicating an absolute path name starting at the root directory of the system

(other pathnames will automatically start from the current working directory, which is /sasend/sas_config/Lev1/SASApp/ in your case)


First, have your system administrator create a mount for your shared drive on your SAS server; after you have received the name of the directory where the shared drive is mounted, use it as the base for your filename.


Your path name looks awfully long at the moment; keep in mind that most operating systems will run out of space for filenames somewhere around 254 characters. And, for ease of use, strictly avoid blanks in file or path names. Use underlines instead.

Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 1 reply
  • 1 like
  • 2 in conversation