BookmarkSubscribeRSS Feed
UlrikkaRae
Calcite | Level 5


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

16 REPLIES 16
ballardw
Super User

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.

SteveDenham
Jade | Level 19

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

UlrikkaRae
Calcite | Level 5

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.

SteveDenham
Jade | Level 19

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

UlrikkaRae
Calcite | Level 5

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

Reeza
Super User

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?

UlrikkaRae
Calcite | Level 5


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?

SteveDenham
Jade | Level 19

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

UlrikkaRae
Calcite | Level 5

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?

SteveDenham
Jade | Level 19

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

UlrikkaRae
Calcite | Level 5

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

UlrikkaRae
Calcite | Level 5

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?

UlrikkaRae
Calcite | Level 5

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

Amir
PROC Star

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 16 replies
  • 8177 views
  • 0 likes
  • 6 in conversation