02-14-2017 02:08 AM
Just wondering if anyone was aware of a SAS setting (so within Base SAS itself or the like) that changes the default variable naming settings when doing any sort of importing (whether that be through proc import of an excel, or just using a data step to set a access database)
Since about a month ago, whenever I try importing things using the above, the variable names are not being assigned consistently, sometimes it follows SAS naming convention (e.g. "Time of Month" would be Time_Of_Month), but othertimes it will import the variable as "Time of Month".
I'm aware of at least the Proc import code to force it to use sas naming convetion, but since this problem is fariyl recent, I'm thinking I must have changed some setting somewhere that switches the default since other people can run it and consistently get the variable to be assigned a sas name.
Thanks all for your help.
02-14-2017 02:19 AM
And if you don't have write access to the autoexec.sas or sasv9.cfg file, just put the options statement right before your proc import step. options validvarname is valid everywhere, not just on SAS invocation.
02-14-2017 11:23 AM
Proc Import and connection to an external DBMS do use different rules. It is very likely that your connection to an external DBMS will try to honor as much of the external DB as practical. So if the DB uses actual spaces in the variable names and your setting for VALIDVARNAME allows it, then you get those spaces.
Proc Import however is a much simpler process and I believe will force any resulting dataset to have the "standard" SAS variable name conventions by default.
Need further help from the community? Please ask a new question.