Thanks. That helped in reading the data. Now I am trying to get to the original problem. It is giving error again. here is the code:
DATA Sample2; /*infile '/folders/myshortcuts/Data/test1.csv' dsd;*/ informat tdate date7.; format tdate date9.; input cust 1-1 @3 tdate date7. @11 amount; Datalines; 1 01Jan12 20 1 05Jan12 40 1 05Jun12 40 1 16Jul12 60 1 25Nov12 10 2 01Jan12 5 2 10Jan12 4 2 08Jun12 34 2 19Jul12 23 2 23Nov12 45 3 08Jan12 23 3 10Jan12 12 3 08Jun12 78 3 19Jul12 55 3 23Nov12 34 ; PROC PRINT DATA=Sample2; run; month=month(tdate); week=week(tdate,'v'); proc summary; class cust week month tdate; var amount; types cust*week cust*month cust*date; output out=stats mean=; run;
The errors I am getting are following. Checked the format of week, month etc. and they match. Do you find any issues. Thanks.
80 month=month(tdate);
_____
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
81 week=week(tdate,'v');
____
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
82 proc summary;
83 class cust week month tdate;
ERROR: Variable WEEK not found.
ERROR: Variable MONTH not found.
84 var amount; types cust*week cust*month cust*date;
ERROR: Variable WEEK not found.
ERROR: Variable MONTH not found.
ERROR: Variable DATE not found.
85 output out=stats mean=;
86 run;
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.STATS may be incomplete. When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.STATS was not replaced because this step was stopped.
NOTE: PROCEDURE SUMMARY used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds
... View more