Hi, I have troubles in doing operation on my data 'ds_code', whose entry are all 6 or 7-digits numerics and characters. Seeing this as a source of trouble, I converted it into character (Line 2108 of the codes below). However, when I got to line 2117 (to identify which entry is the first for the particular ds_code), SAS shows the error message and stops. Could anyone suggest me how to fix this? Your feedback is greatly appreciated. Thanks, Yosh 2104 data ds; 2105 set monthly_prices_yield_and_returns; 2106 sp1lag = lag1(spread_over_benchmark_curve); 2107 sp3lag = lag3(spread_over_benchmark_curve); 2108 char_code = put(ds_code, 7.); 2109 drop ds_code; 2110 rename char_code = ds_code; 2111 run; 2112 2113 Data ds; 2114 retain ds_code c; 2115 old_ds_code=put(ds_code, 6.); 2116 old_c=c; 2117 set ds; ERROR: Variable ds_code has been defined as both character and numeric. 2118 if old_ds_code=ds_code 2119 then c=old_c+1; 2120 else c=1; 2121 run;
... View more