07-18-2015 06:17 AM
I have a many directories: D1,D2, ....Dn
Every directory Dj contains the folder : Test, the folder Test contains the file : loc.xls.
The loc.xls contains coluwn : col1, i want to keep the link to Dk/Test where the column col1 contains only the zero .
v1 v2 col1 b1 b2
1 2 0 8 9
3 9 0 11 3
I want to have
07-18-2015 12:50 PM
1. Use OS methods to list your directories -> Create a SAS table with the list of directories
2. Create a macro to import the xls file and append to master data set
Both of these items are well documented on the forum.
07-18-2015 01:47 PM
Perhaps I'm missing something, how do you know which colums are 0 without reading file?
Edit: I suppose you can use a libname connection and not import but you'll still be connecting to each file.
07-18-2015 08:03 PM
We can see two cases :
Case one : we have an excel file with column : col1
Without reading the table, is it possible to use unix command to extract the table contains col1 ? grep ?
case 2: we have a sas file with column : col1, we want to extract the Dj/test who has a col1 with 0.
Do not forget that, I have so many files
07-18-2015 08:46 PM
As far as I am aware Excel workbooks are stored in a proprietary format that cannot be analysed by any Unix command.
Also I don't follow your logic wanting to verify that column 1 in a spreadsheet contains 0 without "reading the table". You have to read in the Excel file in some form to be able to verify its contents.
If you access Excel from SAS using the EXCEL LIBNAME statement SAS is still reading the data even to create a temporary VIEW. This would one of the options I would recommend.