BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I am using a select * query to extract data from oracle to create a sas dataset.
The problem is, oracle is containing column name with number as initial character or special characters.In the SAS dataset the numebr or special characters are replaced by "_".For e.g. If oracle field name is 1employee* then in SAS dataset the field name will be _employee_.
Things that I have tried out:
1. I have used the option validvarname = any.It gives warning which is not acceptable.
2. SYSERR cannot be used as I am using it to log error message.
3. Printing a part of log to other log also doesnt help.

Please provide some suggestion.
Thanks in advance
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Just curious - what problem are you looking to solve given the SAS system requirement for a non-numeric first char for SAS variables? Best to explain your INPUT and desired OUTPUT condition, with sample data, similar to what you have.

Scott Barry
SBBWorks, Inc.
deleted_user
Not applicable
There are two problems that I am facing:

1. Input column name from oracle : 1employee
Currently SAS gives output like : _employee
Expected Result : 1employee

2. Input column name from oracle : emp*loyee
Currently SAS gives output like : emp_loyee
Expected Result : emp*loyee

By using option validvarname = any the problem gets solved, but it gives warning in log. I dont want that.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Given the SAS architecture limitation, I do not believe you have a choice with naming columns, and more accurately, the problem is circumvented, not solved, with the SAS OPTIONS setting VALIDVARNAME=.

From the SAS support http://support.sas.com/ website, I found some SAS-host DOC reference and also a SAS conference paper on the topic.


Scott Barry
SBBWorks, Inc.

SAS System Option VALIDVARNAME=

http://support.sas.com/documentation/cdl/en/lrdict/61724/HTML/default/a000279245.htm



Avoiding Common Traps When Accessing RDBMS Data
Mike Rhoads, Westat, Rockville, MD
http://support.sas.com/resources/papers/proceedings09/141-2009.pdf

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
  • 637 views
  • 0 likes
  • 2 in conversation