Teradata SQL Assistant

Tools & Utilities
Enthusiast

Teradata SQL Assistant

How can i convert the below SAS function to TEradata

input(substr(scan(dirct_advtsg_src_cd, 5, "-"),1,4),8.) >= 700 

dirct_advtsg_src_cd = 123_234_456_523_708000_7896564

2 REPLIES
Teradata Employee

Re: Teradata SQL Assistant

Try this

SELECT SUBSTR(STRTOK(dirct_advtsg_src_cd,'_',5),1,4)

N/A

Re: Teradata SQL Assistant

I have a number 2147483647.Another random number is generated from the system which is greater than 2147483647 and is sometimes greater than its twice,thrice. As soon as I get the random number, I have to subtract it from 2147483647,store the difference and perform some updates.If the random number is greater than twice of 2147483647 I have to store the difference, perform the updates twice and so on.

Can anyone please guide me on the code synatax for this in teradata?