We all know that SAS develops its software in separate teams, but it can be really annoying when it becomes apparent that several associated teams haven't planned together how a SAS procedure will work.
I'm going to take as an example PROC IMPORT, which is part of Base SAS, but is also included in SAS/ACCESS. When you run the following program all the variables created begin with VAR, i.e. VAR1, VAR2, VAR3, VAR4, VAR5, etc., and this would also be true for DBMS=TAB and DLM:
PROC IMPORT FILE = "test.csv" DBMS = CSV REPLACE;
GETNAMES = NO;
RUN;
However, using similar PROC IMPORT code for DBMS=EXCEL, in SAS/ACCESS for PC Files, will create variables beginning with F, i.e. F1, F2, F3, F4, F5, etc.:
PROC IMPORT FILE = "test.xls" DBMS = EXCEL REPLACE;
GETNAMES = NO;
RUN;
More shocking though is using PROC IMPORT code for DBMS=XLS or XLSX in UNIX or Windows, in SAS/ACCESS for PC Files, as this will create variables with no prefix at all, i.e. A, B, C, D, E, etc.:
PROC IMPORT FILE = "test.xls" DBMS = XLS REPLACE;
GETNAMES = NO;
RUN;
This inconsistency even extends to using GETNAMES = YES too when there are multiple columns with the same label.
If you want to import a CSV file, instead of an Excel file, or indeed import an Excel file in UNIX, then the subsequent processing step will have to be updated to use the new variable names (annoying!). Why can't the procedure be consistent, or, at least, have a parameter, like PREFIX=, that allows users to choose the prefix?
... View more