how to uses ord on a dynamic set

The trick is not to loop over the dynamic set but over the constant set using the dynamic set as a conditional

scalar timestep /3/ ;
Set

Year /2014*2033/

delayYr(year) ’ Years’
;


delayYr(year)$(mod(ord(year)-1,timestep)=0)=Yes;
display delayYr;
scalar val;
loop(Year$delayYr(year),

val = ord(year);
display val;
);

or just:

parameter ordval;
ordval(dealyYr) = (delayYr.val - 2014) + 1;
display ordval;

Cheers
Renger

set year ‘All years’ /2016*2050/;

set yearsub(year) Subset of years;

define subset


loop(year$yearsub(year),

);

Cheers
Renger