DATA Step, Macro, Functions and more

Error when trying to read filenames

Reply
Contributor
Posts: 44

Error when trying to read filenames

I have encountered a strange error. I am using the following code to read filenames that match a given pattern:

filename DIR pipe "dir /B c:\thisdir\abc123*.dat";
data dirlist;
length file $20;
infile DIR length=reclen;
input file $varying20. reclen;
run;

When I run this code everything works as expected. When one of my colleges runs this same code from his account, he gets this error:

NOTE: The infile DIR is:
Unnamed Pipe Access Device,
PROCESS=dir /B c:\thisdir\abc123*.dat,RECFM=V,
LRECL=256

Stderr output:
There is not enough space on the disk.
NOTE: 0 records were read from the infile DIR.
NOTE: The data set WORK.DIRLIST has 0 observations and 1 variables.

There is plenty of disk space on all disks. So, this error is more likely the result of a permission problem, but where? Does anyone have any ideas?
Contributor
Posts: 44

Re: Error when trying to read filenames

Pardon me for replying to my own question but I have some more information to add.

If I start sas by double clicking on a sas icon pinned to the startmenu or taskbar
the following code works:

filename DIR pipe "dir /B";
data dirlist ;
length file $20;
infile DIR length=reclen;
input file $varying20. reclen;
run;
proc print data = dirlist;
run;

However, if I start sas by clicking on "Start -> All Programs -> SAS -> SAS 9.2 (English) that same code results in this error:

NOTE: The infile DIR is:
Unnamed Pipe Access Device,
PROCESS=dir /B,RECFM=V,LRECL=256

Stderr output:
There is not enough space on the disk.
NOTE: 0 records were read from the infile DIR.

I am at a loss to figure out why. Both shortcuts seem to be set up identically. If I
drag the SAS shortcut that was pinned to the startmenu to the desktop and start SAS from that, it fails with the error.

We are running SAS 9.2 on Windows Server 2008. I need to understand the reason for this error so that I can modify the code to run no matter how sas is started.

Thanks.
Respected Advisor
Posts: 3,777

Re: Error when trying to read filenames

See if this is related to your problem

http://support.sas.com/kb/41/863.html
Ask a Question
Discussion stats
  • 2 replies
  • 2329 views
  • 0 likes
  • 2 in conversation