I have a directory of files that I am trying to read into SAS. I am using a macro that has always worked in the past without error on this same directory. Now, inexplicably, it has stopped working properly. The relevant part of the code is, simply, this:
libname infiles 'H:\DGHI\DHS\Data\';
DATA _indiv;
set infiles.&dind;
keep caseid bidx v024 v002 v005 v006 v007 v008 v009 v010 v011 v012 v025 v113 v116 v136 v137 v149 v190 v201 v501 bord b0 b1 b2 b3 b4 b5 b6 b7 b8 b11 b12 b13;
run;
Where "&dind" is the macro variable for the name of the input dataset. There are 14 pre-existing SAS datasets in the directory, all of which need to be read into SAS. 13 of them are working normally, and 1 of them has stopped working (inexplicably ... two weeks ago I ran this exact code on these files with no problems). When I run the above code on this file (which is called KEBR70FL), it gives me:
ERROR: File INFILES.KEBR70FL.DATA does not exist.
Further, if I run PROC DATASETS on INFILES, the file KEBR70FL does not show up! It only shows 13 of the 14 SAS datasets. However, if I navigate to the directory specified by INFILES in Windows Explorer, I can see that the KEBR70FL dataset DOES in fact, exist in that directory.
Now, here is where things get even stranger. The 13 other datasets in that directory (the 13 that are recognized by SAS as existing) I can all right-click and open in either SAS 9.4 OR Sas Enterprise Guide 7.11, just as normal. However, the 14th dataset doesn't even have an option for opening it in SAS 9.4 when I right-click the file! It ONLY lets me open the dataset in Enterprise Guide (and it opens there succesfully, without error).
So, I right-clicked this file and maneuevered to "Open with..." and selected SAS 9.4 in the window that pops up when you use that option. However, it doesn't open the file at all. Nothing happens in SAS 9.4, but when I look back in Windows Explorer after having done this, it has now changed the file type from a SAS dataset to an SD2 file, and output a text document full of error messages (I've copied those at the below).
Even STRANGER is the fact that doing this changed a COMPLETELY DIFFERENT DATASET to an SD2 file as well! One of the 13 files that had previously been working is now suddenly changed to an SD2 file, simply by trying to open this other file in SAS 9.4 (despite it working in Enterprise Guide, as I mentioned)! Not only that, but it changed THE BACKUP COPIES OF THESE DATASETS THAT WERE LOCATED IN A DIFFERENT DIRECTORY! After the file got changed to SD2, I went to the backup directory to retrieve the original SAS dataset version and somehow it had ALSO been changed to an SD2, despite not being connected to any of the above operations in anyway that I can tell.
EDIT: Even worse, the backup file that was overwritten into an SD2 was in a compressed (zip) folder in a different directory, and it was still somehow altered by just trying to open this one file in SAS. It also altered a completely different backup file in a different compressed folder in a different directory.
Does anybody have the slightest idea what is going on, here? I don't understand at all how this dataset got corrupted so that SAS 9.4 wouldn't recognize it anymore (yet it was still recognized by Enterprise Guide), and I CERTAINLY don't understand how any of the above was able to independently corrupt other files located in completely different directories...
(Here are the error messages in the text file that is created along with the SD2 file:
NOTE: Unable to open SASUSER.REGSTRY. WORK.REGSTRY will be opened instead.
NOTE: All registry changes will be lost at the end of the session.
WARNING: Unable to copy SASUSER registry to WORK registry. Because of this, you will not see registry customizations during this
session.
NOTE: Unable to open SASUSER.PROFILE. WORK.PROFILE will be opened instead.
NOTE: All profile changes will be lost at the end of the session.
NOTE: Copyright (c) 2002-2012 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software 9.4 (TS1M3)
Licensed to DUKE UNIVERSITY - T&R - SFA - NCICU GRANT, Site 70082794.
NOTE: This session is executing on the X64_7PRO platform.
NOTE: Updated analytical products:
SAS/STAT 14.1
SAS/ETS 14.1
SAS/OR 14.1
SAS/IML 14.1
SAS/QC 14.1
NOTE: Additional host information:
X64_7PRO WIN 6.1.7601 Service Pack 1 Workstation
NOTE: SAS initialization used:
real time 0.21 seconds
cpu time 0.18 seconds
WARNING: A line of input contains one or more null (hexadecimal 00) characters, which might cause
the SAS System to ignore part of the line. The line, with null characters printed as
question marks, is:
SAS 6.08.04 WIN 3.10 STATTRAN
1 SAS 6.08.04 WIN 3.10 STATTRAN ÀL;
___
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
1 ÑA•c‘T2Æ
__
180
1 ! #8Û 8 ¬Q ÀL;
ERROR 180-322: Statement is not valid or it is used out of proper order.
1 8Û 8 ¬Q ÀL;
_
180
2 The SAS System 11:59 Friday, April 29, 2016
ERROR 180-322: Statement is not valid or it is used out of proper order.
1 ÑAwm%w©\·!êh
____
180
1 ! s `7 è6 x x6
1 ! p 6 p ˜5 p (5 p ¸4 p H4 p Ø3 p h3 p
1 ! ø2 p ˆ2 p 2 p ¨1 p 81 p È0 p X0 p
1 ! è/ p x/ p / p ˜. p (. p ¸- p H- p Ø
1 ! , p h, p ø+ p ˆ+ p + p ¨* p 8* p È)
1 ! p X) p è( p x( p ( p ˜' p (' p ¸& p
1 ! H& p Ø% p h% p ø$ p ˆ$ p $ p ¨# p
1 ! 8# p È" p X" p è! p x! p ! p ˜ p (
1 ! p ¸ p H p Ø p h p ø p ˆ p
1 ! p ¨ p 8 p È p X p è
ERROR 180-322: Statement is not valid or it is used out of proper order.
ERROR: Errors printed on pages 1,2.
NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
real time 0.31 seconds
cpu time 0.18 seconds
)
... View more