replacement variable with string
Posted: Wed Jul 27, 2016 9:20 am
Hello,
Eviews 9 here. I am trying to remove blank rows from svector. If I use equation below with single variable, it works fine.
%slist = ""
%drop = ""
for !i = 1 to @rows(mnemonic_sect_h)
%slist = %slist + " " + mnemonic_sect_h(!i)
if AA(!i)>0 and value( !i)<0.301 then
%drop = %drop + " " + mnemonic_sect_h(!i)
endif
next
But if I replace h with replacement variable %sect "h" "cc" "f" "h" "lm" "mp" "s" - it stops working:
for %sect "h" "cc" "f" "h" "lm" "mp" "s"
%slist_{%sect} = ""
%drop_{%sect} = ""
for !i = 1 to @rows(mnemonic_sect)
%slist_{%sect} = %slist_{%sect} + " " + mnemonic_sect_{%sect}(!i)
if AA(!i)>0 and value( !i)<0.301 then
%drop_{%sect} = %drop_{%sect} + " " + mnemonic_sect_{%sect}(!i)
endif
next
next
Where is the mistake with replacement variable? Thanks
Eviews 9 here. I am trying to remove blank rows from svector. If I use equation below with single variable, it works fine.
%slist = ""
%drop = ""
for !i = 1 to @rows(mnemonic_sect_h)
%slist = %slist + " " + mnemonic_sect_h(!i)
if AA(!i)>0 and value( !i)<0.301 then
%drop = %drop + " " + mnemonic_sect_h(!i)
endif
next
But if I replace h with replacement variable %sect "h" "cc" "f" "h" "lm" "mp" "s" - it stops working:
for %sect "h" "cc" "f" "h" "lm" "mp" "s"
%slist_{%sect} = ""
%drop_{%sect} = ""
for !i = 1 to @rows(mnemonic_sect)
%slist_{%sect} = %slist_{%sect} + " " + mnemonic_sect_{%sect}(!i)
if AA(!i)>0 and value( !i)<0.301 then
%drop_{%sect} = %drop_{%sect} + " " + mnemonic_sect_{%sect}(!i)
endif
next
next
Where is the mistake with replacement variable? Thanks