It seems that "local smpl" will set "smpl @all" according to ative page when calling the subroutine, not the current active page
Code: Select all
wfcreate(wf=hg,page=info) u 8
pagecreate(page=spot) d5 "1968-01-02" "2015-05-31" '12369 obs
table tb
pagecreate(page=pw) w "1991-03-28" "1993-02-24" '100 obs
%pg = "spot"
call subL(%pg,3,1)
pageselect pw
call subL(%pg,2,0)
'smpl if id3<>na ' only 100 obs
subroutine subL(string %pd, scalar !m, scalar !L)
'%pd : wf page name, daily
'!m : tag
'!L : =1, local smpl
pageselect {%pd}
if !L=1 then
local smpl
endif
smpl @all
tb(!m,1) = @otod(1)
tb(!m,2) = @otod(@obsrange)
genr id{!m} = (@day<=!m)
endsub
'1/02/1968 5/29/2015
'3/28/1991 2/18/1993
the 3rd row is expected to be the same as the 2nd row. and only 100 obs in id3 are not Na
