Help using Base SAS procedures

Well, now SAS is not doing this simple Summation

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 88
Accepted Solution

Well, now SAS is not doing this simple Summation

I am trying to use PROC PANEL for an unbalance data set. after receiving this error:

ERROR: There is only one cross section or time series observation. Computations will be

       terminated.

I did what is suggested here http://support.sas.com/kb/22/850.html to check my data set.

this is what I did

data x;

set panelanalysis;

x=tcIHUB  +LABvalue + RADIOvalue + TRANSvalue;

run;

proc print data=x (obs=10);

var tcIHUB  LABvalue RADIOvalue TRANSvalue x;

run;

          
Obs tcIHUB LABvalue RADIOvalue TRANSvalue x
  100100
  200200
  301000
  401000
  501000
  601000
  703000
  801000
  908100
  1009910

Strangely, I see that SAS does not do the summation correctly.all of the values of varia there is no error or warning about data type or anything else in the log.

I suspect that the same reason that makes the summation results to be incorect is casuing the error in PROC PANEL.

Any idea is greatly appreciated!


Accepted Solutions
Solution
‎07-21-2012 10:18 AM
Frequent Contributor
Posts: 88

Re: Well, now SAS is not doing this simple Summation

The problem solved. it was due to OPTIONS SETMISS=0;

interestingly, if you have this option in SAS 9.3, the missing values in will be displayed as zeros but actually remain missing i the background and thus if you add them to another nonmissing variable the result will be missing, but shown as zeros in  the output.

there is no error or warning in log. I think SAS should consider this in their hotfixes or next versions

View solution in original post


All Replies
Respected Advisor
Posts: 2,655

Re: Well, now SAS is not doing this simple Summation

This is just a guess, triggered by how the values for your four variables lined up in the print output.  Is it at all possible that these four variables are somehow character variables?

Steve Denham

Frequent Contributor
Posts: 88

Re: Well, now SAS is not doing this simple Summation

Posted in reply to SteveDenham

Steve; No they are all numeric variables.

But the point is that the very first data set, was created as an output from PROC TRANSPOSE with OPTIONS SETMISS=0; can that be the reason.

the thing which makes it more strange, is that when I ask SAS to print the observations with missing values, I get this result.

proc print data=x;

where missing(x) = 1;

var tcIHUB  LABvalue RADIOvalue TRANSvalue x;

run;

          
Obs tcIHUB LABvalue RADIOvalue TRANSvalue x
  100100
  200200
  301000
  401000
  501000
  601000
  703000
  801000
  908100
  1009910
apparently, SAS considered 0 as a missing value and since I have zeros in the first four column, then the summation shown in the last column missing, but somehow, instead of reporting missing values, they are reported as zero. I just gues this based on the SET MISS=0 option I had used in PROC TRANSPOSE. I am not sure
Super User
Posts: 11,343

Re: Well, now SAS is not doing this simple Summation

Do you get the same behavior in Proc Print with: WHERE X = .;?

Did the log for your data step where you calculated X have any warnings or notes?

Solution
‎07-21-2012 10:18 AM
Frequent Contributor
Posts: 88

Re: Well, now SAS is not doing this simple Summation

The problem solved. it was due to OPTIONS SETMISS=0;

interestingly, if you have this option in SAS 9.3, the missing values in will be displayed as zeros but actually remain missing i the background and thus if you add them to another nonmissing variable the result will be missing, but shown as zeros in  the output.

there is no error or warning in log. I think SAS should consider this in their hotfixes or next versions

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 535 views
  • 0 likes
  • 3 in conversation