Hello, Excuse my SAS ignorance, I have not been working with it for very long. I am new to SAS community, but really enjoying learning about this program and all it can do. I have a question about using pointer controls within a do loop that adjust over each iteration. You can find attached the data I am referencing in this problem. So here is what I'm trying to do. data soi_data;
infile "&work_dir/&input_file" firstobs=5;
input year 1-4 @;
array month {12} mth1-mth12;
do i = 1 to dim(month);
y = 5*i+(i-1);
z = y+5;
input month{i} y-z @;
end;
run; The data has a space deliminator until the end where there are missing values which is why I am trying to use this input syntax. I am trying to increment the "y-z" portion so I can change columns of the input variable without typing, " input Year 1-4 mth1 5-10 mth2 11-16 mth3 17-22" ect for each month. Each mth variable is only 5 lines long, which is why I thought it would be easy to increment it. Obviously with only 12 months to enter, it is not that difficult to do it manually, but I am more just curious why this doesn't work, or if there is a way to get something like this to work? I have tried wrapping the y and z variables with the "int()" function, as well as calculating them within the input statement, but SAS keeps trying to read them as variables, rather than as columns that specify where variable is.
... View more