| Date: | Wed, 15 Mar 2000 13:37:43 EST |
| Reply-To: | frank.ivis@ices.on.ca |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Frank Ivis <frank.ivis@ICES.ON.CA> |
| Subject: | Counting problem |
| Content-type: | text/plain; charset=us-ascii |
|---|
I have data arranged as follows:
id number
1 7
1 7
2 8
2 8
3 7
3 8
4 8
4 7
4 8
5 .
I would like to create a new variable (screen) that for each id, would
indicate whether the 7 occurs for all records (1), only the 8 occurs (2), both
occur (3) or none occur (4).
The final data would look like this:
id number screen
1 7 1
1 7 1
2 8 2
2 8 2
3 7 3
3 8 3
4 8 3
4 7 3
4 8 3
5 . 4
The tricky part is the third condition. I can't figure out how to determine
when the values differ. My final dataset has over 500,000 records, so I'm
hoping there is an efficient solution to this.
I would appreciate it if you could also cc your response to my private email;
I don't always get all the mail from the list.
Thanks in advance for any help,
Frank Ivis
|