Page 1 of 1

tabplace

Posted: Thu Jun 06, 2019 6:23 am
by Katjes
Is there a way to loop over a particular number of rows in tabplace, instead of providing the numbers manually. Instead of

Code: Select all

   tabplace (tab_new, tab_old, "A14","A14","N14")
   tabplace (tab_new, tab_old, "A15","A16","N16")
   

Something like

Code: Select all

   
   !j=14
   for !i=14 to 100  step+2
   %dest="A"+@str(!j)
   %source_a="A"+@str(!i)
   %source_b="N"+@str(!i)
   tabplace (tab_new, tab_old, %dest,%source_a,%source_b)
   !j=!j+1
   next
   

Re: tabplace

Posted: Thu Jun 06, 2019 7:58 am
by EViews Gareth
Yes - doing it the way you suggest will work.

Re: tabplace

Posted: Thu Jun 06, 2019 11:58 am
by Katjes
This was my test version - but if I would add a particular row number (not step 2) saved in an additional table (tab_row) the procedure did not work.

Code: Select all

 
 
    !j=14
    for !i=1 to 5
     scalar row =@val(tab_row(!i))
     !row =row
 
   for !i=14 to 100  step+2
   
   %dest="A"+@str(!j)
   %source_a="A"+@str(!row)
   %source_b="N"+@str(!row)
   tabplace (tab_new, tab_old, %dest,%source_a,%source_b)
   !j=!j+1
   next

Do you have any suggestions?

Re: tabplace

Posted: Thu Jun 06, 2019 7:04 pm
by EViews Gareth
Hard to see what you're doing from that.