I have a CSV file which i want to import in SAS but the column name of CSV have blank space. For example one of the column is 'country code'. I want to remove remove space and put '_' in that place so that column name becomes Country_Code. Any help..how i can do it using SAS Code.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
If it's a CSV (comma delimited), then you shouldn't have any problems here. PROC IMPORT
ought to import the file and change the name for you. It will label the variable including the space, but it should make the change. (Verify this in SAS Display Manager by opening the dataset and selecting View-> Column Names).
If it's not, then you might try (before the proc) adding options validvarname=v7;
. If the setting is currently any
, then technically the name with the space is a valid name; it may pass PROC IMPORT
's checks. If you're using Enterprise Guide, this setting is any
by default.