I have following SAS code that looks for "DailySales" files and import daily sales data into SAS data set. What i would like to do is the code to search for the "DailySales" files and if it doesn't find the "DailySales" files then use the "DailyImport" file.
OK.I will give you a solution.The following code is right. I test it by myself.
filename fname pipe "dir &path.dailysales.txt &path.dailyimport.txt /B";
infile fname truncover;
input fname $20.;
infile dummy filevar=fname end=last length=len;
do until( last);
input row $varying200. len;
if last then stop;
Under Unix, you should use ' ls ' command to check the list of directory.
But from your log, it is to say you do not have right to use PIPE functionality.
If you can ,contact with SAS Administrator, to see whether to open it for you.
If you can not ,can refer to the SAS code which used fopen() function written by SASKiWi at previous post.