Troubles with @datestr
Posted: Fri Mar 01, 2013 2:37 pm
Good afternoon,
I have, what seems to be a simple issue, but may be Friday brain-block is preventing me from seeing a solution. The code
fails to show the next value for %ols_stop, but if I remove ", "yyyy:q"" from it shows the new value (just not in the format that I want.)
I can't see the mistake, since the code above is adapted from another code I've written:
The second code works fine. The difference between them, in theory, is that the first one adds a quarter to each loop, while the second code subtracts from each loop.
My feeling is that the solution is very simple, but my eyes are crossed and I just can't see what's wrong.
Thank you for any suggestions/help.
I have, what seems to be a simple issue, but may be Friday brain-block is preventing me from seeing a solution. The code
Code: Select all
%rec_end = "2012:1"
'
smpl %rec_end %ols_stop
!nQtr = @obssmpl
for !q = 1 to !nQtr
%ols_stop = @datestr(@dateval(%rec_end)+!q-1, "yyyy:q"))
show %ols_stop
nextI can't see the mistake, since the code above is adapted from another code I've written:
Code: Select all
%rec_end = "2012:1"
'
%rec_start = %ols_stop
smpl %rec_end %rec_start
!nQtr = @obssmpl
for !q = 1 to (!nQtr)
%rec_start = @datestr(@dateval(%ols_stop)-!q+1, "yyyy:q")
nextMy feeling is that the solution is very simple, but my eyes are crossed and I just can't see what's wrong.
Thank you for any suggestions/help.