Help using Base SAS procedures

Error: Variable number 0 is not on file

Reply
N/A
Posts: 1

Error: Variable number 0 is not on file

I'm trying to run the proc panel procedure and my code is

proc sort data=cs;
by state year;
run;

proc panel data=cs;
id state year;
slag pop(1)...etc / out=cslag;
run;

but I keep getting the error saying that variable number 0 is not on file. I'm not sure what this means or how to correct it because I don't have any variables with that name. Could anyone provide some assistance?
SAS Employee RMP
SAS Employee
Posts: 52

Re: Error: Variable number 0 is not on file

Are you using the OUTMODEL= option as well as the BY statement? If so, this problem note may be the cause of the problem. In SAS 9.1, you cannot use these together.

http://support.sas.com/kb/16/340.html
New Contributor
Posts: 2

Error: Variable number 0 is not on file

Did you ever fix the "Variable number 0 is not on file" error?  If so could you inform me how you fixed it?  The reply by RMP doesn't appear to address or fix the issue.  Your help is greatly appreciated. 

Frequent Contributor
Posts: 129

Error: Variable number 0 is not on file

It would be helpful if you posted the following:

1.  Version of SAS and operating system

2.  Exact code

3.  Copy of log which includes your code source and the error message.

4.  Proc contents of your CS data set.

New Contributor
Posts: 2

Re: Error: Variable number 0 is not on file

Posted in reply to LarryWorley

Sorry for the mess but here is what you mentioned would be helpful.  Thanks for the help.

1. Version 9.2

2. Below is my code.  I have unbalanced data sorted by company id (gvkey) and year (fiscal year)

proc sort data=final; by gvkey year;run;

Proc Panel data=final;

by gvkey year;

model tDm=zcollateral_lag zlog_assets_lag div_pay_lag zmk_book_ratio_lag

zmed_debt_industry_lag disclose_lag zoper_income_lag constrain_lag zconserve_lag nol_lag zadvert_lag zfor_income_lag

big4_lag zintang_lag dummy06-dummy09 Durable

nondurable Energy Manufact Chemical Health Retail BusEquip Telephone/fixeone; run;

3.  Here is a copy of the log showing the error. 

NOTE: There were 6910 observations read from the data set WORK.FINAL.

NOTE: The data set WORK.FINAL has 6910 observations and 475 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.10 seconds

      cpu time            0.09 seconds

1109

1110  Proc Panel data=final;

NOTE: PROCEDURE PANEL used (Total process time):

      real time           0.07 seconds

      cpu time            0.01 seconds

ERROR: Variable number 0 is not on file WORK.FINAL.

NOTE: The SAS System stopped processing this step because of errors.

1111  by gvkey fyear;

1112  model ztDm=zcollateral_lag zlog_assets_lag div_pay_lag zmk_book_ratio_lag

1113  zmed_debt_industry_lag disclose_lag zoper_income_lag constrain_lag zconserve_lag nol_lag

1113! zadvert_lag zfor_income_lag

4.  The content variables are as follows: 

1 GVKEY                Char   6 $6.       $6.      Global Company Key

13 FYEAR                Num    8 F6.       6.       Data Year - Fiscal

241 constrain_lag        Num    8

202 div_pay_lag          Num    8

207 disclose_lag         Num    8

212 nol_lag              Num    8

464 zadvert              Num    8

428 zcollateral          Num    8

400 zconserve            Num    8

460 zfor_income          Num    8

408 zlog_assets_lag          Num    8

457 zmed_debt_industry_  Num    8

    lag

433 zmk_book_ratio_lag   Num    8

425 zoper_income_lag     Num    8

413 zresearch_lag        Num    8

397 zroa_lag             Num    8

421 zsale_lag            Num    8

417 zsga_lag             Num    8

411 zlog_assets_lag3     Num    8

457 zmed_debt_industry_  Num    8

    lag

433 zmk_book_ratio_lag   Num    8

Ask a Question
Discussion stats
  • 4 replies
  • 561 views
  • 0 likes
  • 4 in conversation