03-25-2015 11:49 AM
This will be embarrassingly easy to someone but I am trying to read in a text file. I have done it in the past. I have it in the same folder as the previous text files. It will recognize the first one but not my new one. I have tried to be extra careful concerning spelling, etc. I do not understand why it can find one but not the other.
03-25-2015 12:06 PM
You will not be able to use your Windows path. But you should be able to simply use an INFILE statement or a FILE= option (depending on how you're reading the data):
I made up some fake data (just 2 rows) and wrote a little program to illustrate. All the program is doing is dumping the records into the SAS log.
03-25-2015 12:29 PM
Thanks but I don't think that will work. The file that already existed works:
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
43 data DetailINP;
44 infile "/folders/myfolders/fabscdataoct.txt" DLM='|' Firstobs=2;
45 INPUT ACCOUNT :$10. LEVEL1 $ LEVEL2 $ DISPLA $ CIRCUIT $
46 CALLS $ MINUTES $ COST $ DISCOUNT $
47 TAXES $ CIRCUITCST $ MRCCOST $ CREDITS $ FINALAMOUNT;
48 put ACCOUNT FINALAMOUNT;
NOTE: The infile "/folders/myfolders/fabscdataoct.txt" is:
Owner Name=sasdemo,Group Name=sas,
File Size (bytes)=116480
But it can't find the other file even though it is in the same directory:
55 data AccountINP;
56 infile "/folders/myfolders/fabscaccountinfo.txt" dlm =' ' Firstobs=1;
57 INPUT ACCOUNT :$10. CompName $ CompAddress $ CompCity $
58 CompState $ CompZip $;
59 put ACCOUNT CompName;
ERROR: Physical file does not exist, /folders/myfolders/fabscaccountinfo.txt.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.ACCOUNTINP may be incomplete. When this step was
stopped there were 0 observations and 6 variables.
WARNING: Data set WORK.ACCOUNTINP was not replaced because this step was
03-25-2015 04:07 PM
Looks like either your Windows session is looking at a different folder or there is some strange character in the filename that is not captured in the screen shot.
Try making a new file from SAS and see if it appears in your Windows Explorer screen.
set sashelp.class ;
file '/folders/myfolders/brand_new_file.csv' dsd ;
put (_all_) (;
03-25-2015 04:59 PM
That works like I believe you were expecting. I see it in the file list in SAS, BUT... I don't see it in Windows Explorer. Windows Explorer should see it, right? Thanks for the help.
03-25-2015 05:24 PM
Looks like you are looking in the wrong folder in Windows. Double check how you mapped the folders in your virtual machine.
03-25-2015 09:34 PM
Couple of things, restart your VM.
You should see the file both in your folder list and your windows explorer.
If the file has weird characters or the input statement is incorrect I've seen SAS UE throw that error, even though the file exists - not helpful.
The file path is case sensitive since it's Unix
03-30-2015 04:02 PM
I looked but it doesn't seem to have the mapping to myfolders. I checked and the one file fabscdataoct.txt only occurs in one directory on the drive where SAS University Edition is. That is where the other one is. It still just doesn't show up and the SAS dataset I created does not appear in Windows Explorer.