05-28-2016 11:51 AM
.TXT files will not appear in a your SAS libraries. That's because .TXT files are called "raw data files" and you can read your raw data file INTO a SAS dataset and then the resulting SAS dataset can be shown in a SAS library and used in Tasks.
How are you using SAS? For example, if you have SAS on your local machine or are using Enterprise Guide on your local machine with a local install of SAS, then you could read the .TXT file from your C: drive.
However, if you are using SAS University Edition in a Virtual Machine, then you will need to put the .TXT file into your shared folders location.
On the other hand, if you are using "the cloud" such as, SAS University Edition on Amazon or SAS OnDemand for Academics, you will need to upload your .TXT file to a folder on the server machine and then read it into a SAS dataset form.
The method you use to read the file will depend on how the file looks. For example, is the data in the file delimited? if so, is it delimited with a comma, a tab, a pipe symbol or some other character? is the file fixed format where every value starts in a same column?
If you are using SAS University Edition, in a virtual machine and you have stored this .TXT file
... in your shared folder location in a subfolder called rawdata and the file is named picnic.txt
Then, let's assume you have made another folder in your shared folder location called perm that will be the location for your permanent SAS library. This program assigns a LIBNAME statement to the PERM shared folder location and reads the picnic.txt file from the RAWDATA shared folder location:
libname perm '/folders/myfolders/perm';
length name $8 wants_grilled $30 condiment $20;
infile '/folders/myfolders/rawdata/picnic.txt' dlm=',' dsd;
input name $ wants_grilled $ condiment $;
proc print data=perm.picnic;
and the results are shown below. Note that the location would be the same on the Amazon AWS, you would still need to upload picnic.txt to the server and you would still need to make the folders on the server to hold the .TXT file and the permanent library.
In SAS OnDemand for Academics server, you would still upload the data, but your location would be different. The 2 statements that would have to change would be the LIBNAME and the INFILE statement (assuming that you made the same folders on your server account):
libname perm '/home/your_userID/perm';
infile '/home/your_userID/rawdata/picnic.txt' dlm=',' dsd;
Since you did not say how you were using SAS, and what folder structure you were using it is hard to provide more concrete code examples, but this one should be enough to get you started.