Well I am not sure this will help but in my case I have a double nested do loop and the outer loop is hard coded to 1-5 for 5 acad_careers and it really should be soft coded to my key shown before... to build out a calendar of snapshot db dates and cross walk information for the terms/acad_careers for reporting purposes for example -9 weeks before term A. compared to -9 weeks before term B. bla bla... I was trying to save the list from a lot of details that are not important to the big picture...
Anyway here is a bit more verbose code do loop but still very stripped down from my final need.
data calendar;
format t_SNAP_DATE date9.;
/* this next line needs to become */
do j = 1 to 5;
/* efectivly somthing like this next line at least from a hard coded example I saw on a blog page */
do j = 2137*BUSN, 2137*GRAD, 2137*MEDI, 2137*PHAR, 2137*UGRD, 2137*VETM, 2140*UGRD, 2143*BUSN, 2143*GRAD, 2143*MEDI, 2143*PHAR, 2143*UGRD, 2143*VETM, 2145*BUSN, 2145*GRAD, 2145*MEDI, 2145*PHAR, 2145*UGRD, 2145*VETM, 2147*BUSN;
/* however I do not want it hard coded, like above I want to make it softcoded if posible ??????
I want the 'key' to be the control list and to be able to use the two fields &strm. + &acad_career. in the body of my do loop. And as you can see I do not 'set' a data set in this code I am building it from scrach, my output needs to be keyed on SNAP_DATE, STRM, and ACAD_CAREER oops I think my proc sql needs to pass along start date too, however I can do that on my own... that is all I can add at this time, Does that help???????? */
do i = -386 to &term_day_ct.;
STRM=&STRM.;
/* 1 2 3 4 5 */
ACAD_CAREER=j; /* will be changed from number to GRAD, MEDI, PHAR, UGRD, VETM, etc later */ /* so the above becomes */ ACAD_CAREER=&ACAD_CAREER.;
/* etc */
term_begin_dt=put(Intnx( 'Day' , "&term_begin_d."d, 0 ),date9.);
SNAP_DATE=put(Intnx( 'Day' , "&term_begin_d."d, i ),date9.);
t_SNAP_DATE=(input(SNAP_DATE,date9.));
month=month(t_SNAP_DATE);
output;
end;
drop i;
end;
drop j;
run ;
... View more