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.
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.
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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.