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
replacement variable with string
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: replacement variable with string
Code: Select all
for %sect h cc f h lm mp s
Re: replacement variable with string
I have tried your suggestion and it still does not work - gives me blank svectors for each of h cc f h lm mp s.
for %sect h cc f h lm mp s
'delete mnemonic_sect_{%sect}1
%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
svector mnemonic_sect_{%sect}1= @wsplit(@wdrop(%slist,%drop))
next
for %sect h cc f h lm mp s
'delete mnemonic_sect_{%sect}1
%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
svector mnemonic_sect_{%sect}1= @wsplit(@wdrop(%slist,%drop))
next
Who is online
Users browsing this forum: No registered users and 2 guests
