"ERROR: No data set open to look up variable" genmod proc.

Reply
Occasional Contributor
Posts: 16

"ERROR: No data set open to look up variable" genmod proc.


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).

sasexample3.png

   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

Super User
Posts: 11,343

Re: "ERROR: No data set open to look up variable" genmod proc.

Posted in reply to UlrikkaRae

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.

Respected Advisor
Posts: 2,655

Re: "ERROR: No data set open to look up variable" genmod proc.

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.

Steve Denham

Occasional Contributor
Posts: 16

Re: "ERROR: No data set open to look up variable" genmod proc.

Posted in reply to SteveDenham

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.

Respected Advisor
Posts: 2,655

Re: "ERROR: No data set open to look up variable" genmod proc.

Posted in reply to UlrikkaRae

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.

Steve Denham

Occasional Contributor
Posts: 16

Re: "ERROR: No data set open to look up variable" genmod proc.

Posted in reply to SteveDenham

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...).

Super User
Posts: 19,861

Re: "ERROR: No data set open to look up variable" genmod proc.

Posted in reply to UlrikkaRae

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?

Occasional Contributor
Posts: 16

Re: "ERROR: No data set open to look up variable" genmod proc.


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)

(1)

ex with where and ref_no.png

(2)

ex without where and ref no.png

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?

Respected Advisor
Posts: 2,655

Re: "ERROR: No data set open to look up variable" genmod proc.

Posted in reply to UlrikkaRae

Hi,

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.

Steve Denham

Occasional Contributor
Posts: 16

Re: "ERROR: No data set open to look up variable" genmod proc.

Posted in reply to SteveDenham

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?

Respected Advisor
Posts: 2,655

Re: "ERROR: No data set open to look up variable" genmod proc.

Posted in reply to UlrikkaRae

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.

Steve Denham

Occasional Contributor
Posts: 16

Re: "ERROR: No data set open to look up variable" genmod proc.

Posted in reply to SteveDenham

Thank you Steve. This has been very helpfull, cause it gives me some important clues. Your time has been much appreciated.

Occasional Contributor
Posts: 16

Re: "ERROR: No data set open to look up variable" genmod proc.

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.

sasex4.png

On another note, why is the guessingrow statement not working? Am I using it completely wrong here?

Occasional Contributor
Posts: 16

Re: "ERROR: No data set open to look up variable" genmod proc.

Posted in reply to UlrikkaRae

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 Smiley Happy

Super Contributor
Posts: 282

Re: "ERROR: No data set open to look up variable" genmod proc.

Posted in reply to UlrikkaRae

Hi,

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"?


Regards,

Amir.

Ask a Question
Discussion stats
  • 15 replies
  • 2334 views
  • 0 likes
  • 5 in conversation