BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
supp
Pyrite | Level 9

Hello, I am connecting to a Teradata database. There are columns that I need to be numeric to perform calculations. In Teradata these columns are varchar(50). I have tried the 'dbtype' option with no luck:

 

LIBNAME teradata teradata server=server USER=user PASSWORD=password schema=schema;

data work.want; set teradata.have(dbtype=(COL_1='Numeric(3)')); run;

The program runs without error but COL_1 is still character, not numeric. I have also tried adding a format statement before the set statement

format COL_1 3.;

But then I get an error that COL_1 has been defined as both numeric and character.

 

How do I bring in COL_1 as numeric?

 

1 ACCEPTED SOLUTION

Accepted Solutions
3 REPLIES 3
SASKiwi
PROC Star

The correct option to use is DBSASTYPE:

https://documentation.sas.com/?docsetId=acreldb&docsetTarget=n0v4ma1zb9lu99n1728j279rjcqi.htm&docset...

 

DBTYPE is used when creating database tables.

supp
Pyrite | Level 9
Thanks @SASKiwi, this was it! Thanks for the explanation of the two options.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1158 views
  • 4 likes
  • 3 in conversation