BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I am importing table from Excel.
Field names such as F123, F191, etc
In SAS Data table names appear as "F123", "F191" etc
But when using them, SAS expects names to be "_F1232", "_F191", etc.

How can I set it up to not preceed the name with "_"?

thanks!
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Please share more info about just how you are "importing" your data, and include some specific SAS log (pasted in your post reply) to more accurately explain the SAS problem you are experiencing. It does not make sense that SAS would read up a data column into a SAS variable and not reference the variable as expected. Do remember though that SAS variable names must start with a character.

Below please find a useful Google advanced search argument against the SAS support http://support.sas.com/ website where you may find relative topic information and product documentation:


sas variable names start character site:sas.com

Scott Barry
SBBWorks, Inc.

SAS 9.2 Language Reference: Concepts - Names in the SAS Language
http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a000998953.htm
deleted_user
Not applicable
I'm importing using the "Import Data" wizard under the "File" menu option. Standard excel file.
The SAS Data table is created and when I view it, I see my field names (column headers) as "F123", F124", etc

When I do a Proc print, the field names are "_F123" etc.

Here is the log:

NOTE: SAS initialization used:
real time 8.70 seconds
cpu time 1.73 seconds

NOTE: PARTIAL.GLT was successfully created.


1 proc print data =partial.glt;
2 run;

NOTE: There were 1555 observations read from the data set PARTIAL.GLT.
NOTE: PROCEDURE PRINT used (Total process time):
real time 1.09 seconds
cpu time 0.14 seconds
deleted_user
Not applicable
OK - problem identified - there was a space in front of the field names in excel - and SAS will add the underscore to any illegally named field.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 2115 views
  • 0 likes
  • 2 in conversation