@John89 wrote: I have a job of appending 100s of excel sheets into one and reformatting, unfortunately some of the variable names length are greater than 32 and when I try reformat using ‘format ‘ ‘ n best12.’, the code shows a warning as uninitialised. When I try the same code in SAS EG it works perfectly, any suggestions?
Please show an exact statement as submitted and the message from Log. If you reference a variable that does not exist that is the typical message.
If your are running EG you often encounter settings used by a server that may not be in effect in a stand alone version of SAS involving naming literals. If you run this code:
proc options option=validvarname;run;
and get in the log
VALIDVARNAME=V7 Specifies the rules for valid SAS variable names that can be created and
processed during a SAS session.
then use of name literals is not set. You could make that available using in your program
options validvarname=any;
and reset to the default with
options validvarname=V7;
when you no longer want to use name literals.
I would strongly suggest NOT using validvarname=Any as the sometimes way to long columns many users place in Excel become a pain to deal with. You might consider using the actual column headings as LABELS though.
If you want to set all of the numeric variables better would be: Format _numeric_ best12. ; However if you have dates, times or datetime values this would also set their formats.
... View more