BookmarkSubscribeRSS Feed
jdell
Calcite | Level 5
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?
4 REPLIES 4
RMP
SAS Employee RMP
SAS Employee
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
pm_utd
Calcite | Level 5

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. 

LarryWorley
Fluorite | Level 6

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.

pm_utd
Calcite | Level 5

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

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2117 views
  • 0 likes
  • 4 in conversation