turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Well, now SAS is not doing this simple Summation

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-20-2012 03:40 AM

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 |

1 | 0 | 0 | 1 | 0 | 0 |
---|---|---|---|---|---|

2 | 0 | 0 | 2 | 0 | 0 |

3 | 0 | 1 | 0 | 0 | 0 |

4 | 0 | 1 | 0 | 0 | 0 |

5 | 0 | 1 | 0 | 0 | 0 |

6 | 0 | 1 | 0 | 0 | 0 |

7 | 0 | 3 | 0 | 0 | 0 |

8 | 0 | 1 | 0 | 0 | 0 |

9 | 0 | 8 | 1 | 0 | 0 |

10 | 0 | 9 | 9 | 1 | 0 |

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to niam

07-21-2012 10:18 AM

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

All Replies

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to niam

07-20-2012 07:10 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

07-20-2012 11:33 AM

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 |

1 | 0 | 0 | 1 | 0 | 0 |
---|---|---|---|---|---|

2 | 0 | 0 | 2 | 0 | 0 |

3 | 0 | 1 | 0 | 0 | 0 |

4 | 0 | 1 | 0 | 0 | 0 |

5 | 0 | 1 | 0 | 0 | 0 |

6 | 0 | 1 | 0 | 0 | 0 |

7 | 0 | 3 | 0 | 0 | 0 |

8 | 0 | 1 | 0 | 0 | 0 |

9 | 0 | 8 | 1 | 0 | 0 |

10 | 0 | 9 | 9 | 1 | 0 |

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to niam

07-20-2012 01:42 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to niam

07-21-2012 10:18 AM

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