BookmarkSubscribeRSS Feed
PhatRam33
Fluorite | Level 6

Hello, I'm trying to convert a variable that is stored as a BIGINT from a Neteeza database to a character data type and have not had much luck in doing so.  I'm trying to convert this data type in a join without using a pass-through query and was wondering if this is possible.

 

Table1 as t1 Inner Join Table2 as t2 on t1.ID = put(t2.ID,20.)

 

Have to convert to a character with a length of 20.  Received errors with this piece of code.

 

Thanks in advance.

4 REPLIES 4
Patrick
Opal | Level 21

@PhatRam33

Please post the relevant section from your log or at least the full error message.

 

If you say pass-through: Implicit or explicit?

If explicit then you need to use Netezza functions - to_char()

https://www.ibm.com/support/knowledgecenter/en/SSULQD_7.2.1/com.ibm.nz.dbu.doc/r_dbuser_ntz_sql_extn...

 

If implicit then be aware that the SAS put() function gets eventually not pushed to the data base meaning that SAS will pull all the data first into SAS before applying the join condition.

 

According to docu SAS can deal with Bigint and the put() function as such should work. So please show us some log so we can better understand what's going wrong.

http://documentation.sas.com/?docsetId=acreldb&docsetTarget=p07ge3f7fvfh5ln1msgdpqhbeh31.htm&docsetV...

PhatRam33
Fluorite | Level 6

It is an implicit query.  Tried

dbsastype=(IM.Field1='char(20)')

 

Still receiving same error.

Patrick
Opal | Level 21

@PhatRam33

What's the error? Which SAS version are you using? Which library engine are you using?

Could it be related to: http://support.sas.com/kb/38/707.html ?

PhatRam33
Fluorite | Level 6

It is the numeric value out of range error.  SAS EG 6.1 on UNIX. I think I may just stick with an explicit query as it works there. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 4 replies
  • 2323 views
  • 1 like
  • 2 in conversation