Page 1 of 1

Replacing values after a specified date

Posted: Mon Jan 09, 2012 9:02 am
by acraigpgpf
I'm brand new to programming. I am trying to replace values after a certain date in an annual dataset.

for !i = 2010 to 2085

if !i>= 2022 then altdocfix =5555
endif

next

Rather than replacing values after 2021 with 5555, this loop replaces ALL values. Any suggestion?

ac

Re: Replacing values after a specified date

Posted: Mon Jan 09, 2012 9:22 am
by startz
You want to use the smpl statement, not if.

Code: Select all

smpl 2022 @last altdocfix =5555 smpl @all

Re: Replacing values after a specified date

Posted: Mon Jan 09, 2012 9:41 am
by acraigpgpf
Thanks!