下边是我编的一个非常简单的程序。不幸的是错得一塌糊涂(悲哀)。找了很久都不知道错在哪里。请帮忙看一下。谢谢!
*-----------------------------------------------------------------------------
*Program Name: P_2.1.SAS stored in the C:\books\learning\my program folder
*Purpose: The program reads in data on stock prices and sharesoutstanding
*and compute the value and average price and the averrage number of shares.
*Programmer: Ch
*Date Written: Feb, 2008.
*-----------------------------------------------------------------------------
data problem2_1;
infile "C:\books\learning\stocks.txt";
input StoCode $ Price Share;
Value=price*Share;
run;
Title "Prob Data";
proc print data= problem2_1;
run;
title "Summary Statistics";
proc means data= problem2_1;
var price share;
run;
下边是debug的信息:52 *-----------------------------------------------------------------------------
53 *Program Name: P_2.1.SAS stored in the C:\books\learning\my program folder
54 *Purpose: The program reads in data on stock prices and sharesoutstanding
55 *and compute the value and average price and the averrage number of shares.
56 *Programmer: Ch
57 *Date Written: Feb, 2008.
58 *-----------------------------------------------------------------------------
59 data problem2_1;
60 infile "C:\books\learning\stocks.txt";
61 input StoCode $ Price Share;
62 Value=price*Share;
63 run;
64 Title "Prob Data";
65 proc print data= problem2_1;
ERROR: File WORK.PROBLEM2_1.DATA does not exist.66 run;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used:
real time 0.00 seconds
cpu time 0.00 seconds
67 title "Summary Statistics";
68 proc means data= problem2_1;
ERROR: File WORK.PROBLEM2_1.DATA does not exist.69 var price share;
ERROR: No data set open to look up variables.ERROR: No data set open to look up variables.70 run;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE MEANS used:
real time 0.00 seconds
cpu time 0.00 seconds
我起初以为是文件路径错了。但经检查没错,我真的百思不得其解,望指点迷津。谢谢!