07-12-2012 10:36 PM
I merge some tables using SAS Enterprise Guide. Afterwards I create a report based on this merged data set. Is there any chance to change the database names of the attributes to a user friendly name, meaning using spaces and variable names with a length greater than 32 characters?
If this is possible, can I write a program in EG which renames all variables based on a csv-List (looking for example like: "databaseAttributeName;New Name With Special characters" ).
Thank you very much in advance for your answers
07-19-2012 04:13 PM
SAS variable names cannot have embedded spaces or special characters. Labels are for this, as Reeza already stated. Once you define labels, the dataset can be viewed with labels and reports can be created/printed using labels rather than variable names using "label" option in a procedure call (e.g. proc print).
07-27-2012 01:40 AM
thanks for your answers and sorry for coming back to you so late. I am trying the following script:
proc import datafile="c:\columnsdescriptions.xls"
*filename gencode temp;
filename gencode 'C:\gencode.sas';
set work.labels end=eof;
if _n_=1 then do;
put "proc datasets lib=LIB nolist;"/
put ' label ' variable ' = "' label '";';
if eof then put "quit;";
*error occurs here:
filename gencode clear;
this throws the error: ERROR: The HEADER/VARIABLE UPDATE function is not supported by the ODBC engine.
I don't understand this error message, as I am just trying to change the internal label and not a column name in the database. Any ideas on how to solve that?
07-27-2012 05:32 PM
What is your LIB library? Is it defined using the ODBC engine?
Perhaps it has something to do with the problem reported in this SAS note for Access to Oracle:
SAS/ACCESS® software's LIBNAME engines support creating tables as well as reading from and writing to tables, but they do not support table altering.