I am doing some calculation like
data output;
set input;
A= (col1* col2*col3)/(100000*col4);
run;
My value in A is always less than 10,000 but when I am loading this output datasset in the MS SQL table it is giving an error Numeric out of range.
One option is to increase the length of column in SQL table but I am looking for solution - what should I do in data step so that data can be inserted into MS SQL table without getting an error.
The place holder in MS SQL have sufficient length.
Seondly, I also tried using round function in data step but it didnt help.
You don't say what the number in col4 is but my guess is that once you multiply that by 100,000 you're exceeding the largest number that SQL Server can hold. A similar thing happened on one system I worked on with ORACLE.
What is your columns definition i SQL Server, and what values are rejected?
Existing definition - decimal(24,10)
When I changed to decimal(27,10) then it works.
I do not want to change the existing definition.
Ok, not following. Either it fits, or not. Can't see that this is a SAS problem.
It seems that you either need to fix your data, or your columns definitions.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.