String comparison (a question about @pagefreq)
Posted: Wed Oct 20, 2010 6:01 am
Hi.
I am writing a subroutine to calculate percentage change rate. This calculation is workfile specific
so I used @pagefreq to return current workfile frequency and compare it to an existing
string. However, the program keeps giving error message such as %w=w is not specified etc.
(I actually changed the code to "string %w=w" or String %w="w", but neither one works.
Anyone can tell me what I did wrong in the coding? Thanks in advance.
I am writing a subroutine to calculate percentage change rate. This calculation is workfile specific
so I used @pagefreq to return current workfile frequency and compare it to an existing
string. However, the program keeps giving error message such as %w=w is not specified etc.
(I actually changed the code to "string %w=w" or String %w="w", but neither one works.
Anyone can tell me what I did wrong in the coding? Thanks in advance.
Code: Select all
subroutine pcna(series x, scalar n)
%f=@pagefreq
%w=w
if %f=%w then
series pcn=(x-x(-n))/x(-n)
series pcna=pcn*52/n
endif
endsub