List of series with end date earlier than a benchmark
Posted: Mon Jan 26, 2015 6:59 pm
Im trying to create a string list of all the series in a workfile whose end date is before a certain benchmark end date which Ive stored as a scalar program variable (using @dateval) called !current. By end date of a series I mean the last non-NA value.
The above code does the job, But Im wondering if there is a more efficient way of doing this, as it seems computationally expensive.
We can do this operation in a single line of code in AREMOS. Thanks!
Code: Select all
group short
for %co {%alls}
smpl if TUBPSF{%co}<>na
!end_date = @dateval(@otods(@obs(TUBPSF{%co})))
if !end_date<!current then
short.add TUBPSF{%co}
endif
next
%shorts = short.@membersWe can do this operation in a single line of code in AREMOS. Thanks!