Do the join where your data lives - so do it in Oracle. I was thinking that it shouldn't be too hard to convert character to numeric (or the other way round) in Oracle using either TO_NUMBER() or TO_CHARACTER.
Being an iregular Oracle user I Googled the doc to post the correct syntax - and then look what I found under Datatype Comparison Rules
"When comparing a character value with a numeric value, Oracle converts the character data to a numeric value."
is it possible to add leading "0"s to a numeric variable in SAS and still have it as numeric?
The interal storage of numbers doesn't change but for any time you want to SEE leading zeroes use the Zw.d format.
i think so , i will defiantly post it. If i come up with come up some thing...
So my A is still numeric variable.
but its internal value is 374747830939 , it looks like 000374747830939 .
You can add as many leading zeros to a number as you want and it will not change the value.
0 x 10**100 is still 0.
You cannot add leading zeros to a number. It just does not make sense either mathematical or in computer science.
What is your actual problem? Are you having trouble querying the data? Or matching records between two tables (datasets) ?
Can you show the example data?
With SAS you can add a format to display a number with leading zeros. You can even have the format permanently attached to the variable in the definition of the dataset so that the default for displaying the number will include the leading zeros. I do not think you can do the same in Oracle. You can use a function call to convert a number to a character string and specify that leading zeros are printed. Is that what you want to know how to do? To do that in Oracle use to TO_CHAR function with a format.
Example:
to_char(12.349,'099999.99') returns "000012.35"
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.