Inicio > Programming, Shorts > Verificar la existencia de un archivo externo

Verificar la existencia de un archivo externo

Verificando la existencia de un archivo externo utilizando la sentencia FILEEXIST.

%macro existe(archivo);
%if %sysfunc(fileexist(&archivo))=1 %then %do;
data a;
infile “&archivo”;
input var $;
run;
%end;
%else %do;
data _null_;
put “Error:Archivo &archivo No Existe”;
run;
%end;
%mend;

/* Llamada a la macro para verificar si el archivo exite */
%existe(c:\lasug.txt);

Advertisement
Categorías:Programming, Shorts
  1. Aún no hay comentarios.
  1. Aún no hay trackbacks

Deja un comentario

Fill in your details below or click an icon to log in:

Gravatar
Logo de WordPress.com

Please log in to WordPress.com to post a comment to your blog.

Twitter picture

You are commenting using your Twitter account. Log Out / Cambiar )

Facebook photo

You are commenting using your Facebook account. Log Out / Cambiar )

Connecting to %s

Seguir

Get every new post delivered to your Inbox.