Hello, I'm using SAS 9.3.1 and I am trying to assign the values of a variable (demand) from a file (a) to a new set of variables using do loops. The problem is that the file 'a' has 5 observations and therefore after the first execution it reads all the data perfectly. But for the second round (i=2) it cannot perform the same task and start reading the file 'a' just like the previous iteration. It is like when a file is read once cannot be read for the second time. As the result, I don't have the desired outputs for the second run. Please note that the program executes without showing any error. I'm forwarding you the whole file in which you can find this specific part with all data example I'm using. I do appreciate your time helping me to find out the problem. Best Regards, Mina do i=1 to 2; _type_='GE'; _row_='Res_P'||put(i,1.); _col_='_RHS_'; _coef_=0; output; _type_=' '; do k=1 to 4; _col_='Y'||put(i,1.)||put(k,1.); _coef_=1.0; output; end; do h=1 to 5; set a; _col_='Z'||put(i,1.)||put(h,1.); _coef_=1.0; output; _col_='S'||put(i,1.)||put(h,1.); _coef_=-demand; output; end; end;
... View more