10-30-2013 08:36 AM
I don't know why I'm getting this message "ERROR: No data set open to look up variable" when I use the genmod proc. I HAVE specified the dataset an it works fine when using the dataset in other procedures (like the proc contents seen below).
What really confuses me is that the exact same code works when working with another dataset in another window.
Can anyone tell me what I'm doing wrong here? Is it to do with the code or the datset or...?
Kind regards Emilie
10-30-2013 10:31 AM
Have you run a freq on the variable ref__no_? It may be all missing. If the where clause results in no records it might cause that error message.
10-31-2013 08:10 AM
Following on that notion, is ref__no_ a character variable in the dataset? If so, the where clause should change to where=(ref__no_ ne ' '). Still, something isn't quite right. However, since ref__no_ is the subject, if it is indeed missing, using the where clause can be dropped, as only those observations that have non-missing values will be used as subjects.
10-31-2013 09:00 AM
Thank you for your answer. I've tried excluding the ref_no totally, but it still doesn't work: I get the following: "Response variables cannot be listed in the CLASS statement" or just "The SAS System stopped processing this step because of error" and sometimes the log even tells me "no dataset to look up variables"! Why suddenly that? It DOES have a dataset decribed for it!. I have tried reducing the code too, see answer to Ballard, but that doesn't help either.
11-01-2013 07:48 AM
Is it possible to provide a copy of the dataset? At least a partial copy with the first 10 or so rows would enable everyone to address what is going on, I think.
11-01-2013 07:26 PM
I would love to share a copy, but as far as I can see I can't attach anything else than an image or a film here? Or can I? It's simply to large, the dataset, to take a photo of it - there are too many columns (about 50 of them...).
11-02-2013 12:30 PM
To attach data, click the advanced editor on the top right hand side of the reply box.
Can you post the log from the contents and proc?
11-03-2013 05:47 AM
Thank you Reeza. Here it is, sample of the dataset attached and beneath the log for both the code shown in my first post (1) and the log for the same code but without the WHERE statement and the variable ref__no_ (2)
I think it's important to note that the code shown in my first post has worked fine untill I made an update of SAS from 9.1 to 9.4 and had to import the dataset again. Maybe it's reading the variables differently now?
11-04-2013 08:45 AM
I imported the leptocopy.xls dataset, saving it in my work directory as ark1. I had no problems running the first set of code in 9.4. The second code section did throw an error - All variables in the SUBJECT effect must be listed in a CLASS statement - which is exactly what I would expect. I think any problems lie in the import process, and not in the GENMOD code.
11-12-2013 10:00 AM
Thank you very much Steve for trying it out! I have now contacted sas technical support to try and find out how I overcome the problem of office 32bit on a 64bit operative system. It is said that this should help with the import wizard which will let me control how the variables are being comprehended by sas.
Please tell me, what import method did you use? Did you use proc import, or the import wizard?
11-12-2013 11:14 AM
I used the import wizard. I suppose I could have saved the code (last step), but I was more worried about whether the error was in the GENMOD code than whether the data were not coming across. I did this in a 64 bit SAS/64 bit windows environment.
10-31-2013 08:56 AM
Yes I've tried a proc freq and a proc print and it looks like it should, including the ref_no variable. And I've tried with and without the WHERE statement, but the log either tells me "Response variables cannot be listed in the CLASS statement" (and I don't get what that means - what is a response variable?) or it just tells me:
"The SAS System stopped processing this step because of error" with no information on the actual error.
On another note, why is the guessingrow statement not working? Am I using it completely wrong here?
10-31-2013 09:05 AM
About the guessing rows, think I just got it now that you can only use that in a proc import procedure, and not like I have done here. So forget that question
10-31-2013 08:32 AM
I don't know if it would cause the error, but just to rule it out, does the variable ref__no_ on the data set genuinely have two consecutive underscores between "ref" and "no", or should it be ref_no_ with one underscore between "ref" and "no"?