If you are using Teradata and need to convert an attribute that is a character-type to a numeric-type, let me suggest that you do the work using "explicit SQL" in the native Teradata SQL dilect, and not in SAS-SQL.
The example below shows the steps I use. Only the last is truly needed. The regex replace function removed any remaining non-numeric characters, like any potential nonprinting characters.
SELECT '00000000012345678912' , TRIM( LEADING '0' FROM '00000000012345678912' ) , REGEXP_REPLACE( TRIM( LEADING '0' FROM '00000000012345678912' ), '[^0-9]+','',1,0,'i') , CAST( REGEXP_REPLACE( TRIM( LEADING '0' FROM '00000000012345678912' ), '[^0-9]+','',1,0,'i') AS BIGINT ) ;
You may be able to use the INTEGER datatype. Instead of a BIGINT.
The number in your example (12,345,678,912) is a BIGINT, a 64-bit (8-byte) signed integer. Range: -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
... View more