BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

I execute the following in SAS 9.1:
proc sql;
create table work.test1(x int);
quit;

data work.test11;
length x 4;
set work.test1;
run;

proc sql;
insert into work.test11
values (20081101)
;
quit;
/* !! 20081101 --> 20081088 in work.test11 */

I have the unpleasant surprise to see that inserting the integer value 20081101 into a 4-byte numeric column changes the value to 20081088.

Is this a serious bug in SAS or am I doing something wrong?

Thanks in advance for help,
Chris
2 REPLIES 2
deleted_user
Not applicable
Thanks a lot for pointing that resource, urchin.
Until now , I thought that 4 bytes for numeric type in SAS can hold 32 bits of integer values, thus the limit (for signed integers) of around 2 billion for positive values.
Now I realize that SAS stores in a different way the numeric values and I also wonder if there is a way to have 4 bytes numeric size and still be able to hold 32 bits signed integers (in other words, is there a way to change the way SAS stores integers?).

Chris

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 562 views
  • 0 likes
  • 1 in conversation