%let fname=&dataroot&psep.st_26.csv;
%macro TABLES;
%if %sysfunc(fexist(&fname)) %then
%do;
filename st_spec &fname;
data st_26;
infile st_spec dsd firstobs=2 truncover dlm=',';
input date:mmddyy10.;
run;
%end;
%else %do;
%put No schedule table exists;
%end;
%mend
In a call to the FEXIST routine, the fileref /home/rwn/ksde/data/ftp/st_26.csv exceeds 8 characters, and will be truncated.
Because of this, it is returned the wrong result.
how do I fix it?
Hi,
Try this...Hope it helps..
%let fname=&dataroot&psep.st_26.csv;
%macro TABLES;
filename st_spec "&fname";
%if %sysfunc(fexist(&fname)) %then
%do;
data st_26;
infile st_spec dsd firstobs=2 truncover dlm=',';
input date:mmddyy10.;
run;
%end;
%else %do;
%put No schedule table exists;
%end;
%mend;
%tables;
Thanks,
Shiva
Use fileexist() to replace fexist().
Ksharp
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.