|
Debbie,
Note: In an off-list exchange, Debbie confirmed that her incoming data set
is structured as ONE record per case with the following organization:
Location,
Product,
Orderdate,
effective_start_date1 through effective_start_date21,
end_date1 - end_date21,
source1 through source21,
You'll have to try this out and report back if there are errors.
Vector start=effective_start_date1 to effective_start_date21/
end=end_date1 to end_date21/
source=source1 to source21.
* I assume that orderdate will never be greater than the last ending date
* and never less than the first starting date.
* I assume that an order date can never be between an ending date and the
* following date.
* I assume that an ending date and the following start date will never be
* the same date.
* I also assume that the number of ending dates, starting dates and sources
* always match.
Loop #i=1 to 21.
+ do if (start le orderdate and end ge orderdate).
+ compute validsource=source(#i).
+ else.
+ break.
+ end if.
End loop.
Gene Maguin
|