cleaning a table

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

basil
Posts: 37
Joined: Thu Apr 28, 2011 11:48 am

cleaning a table

Postby basil » Thu May 12, 2011 9:39 am

How do I empty all entries of a table?

I would like to reset the table to be empty after each iteration. The following does not work in EViews 6:
table t=””

My solution is:
table t
delete t
table t
(I need the first line in order to avoid an error in the second line)

Any suggestion for better ideas?

Thanks,
Basile

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: cleaning a table

Postby EViews Gareth » Thu May 12, 2011 9:45 am

Deleting the table is the only way to completely empty it.

basil
Posts: 37
Joined: Thu Apr 28, 2011 11:48 am

Re: cleaning a table

Postby basil » Thu May 12, 2011 10:04 am

thanks for your quick response.
Just a quick follow up: is there a way to use "delete t" without creating an error in case where t does not exit?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: cleaning a table

Postby EViews Gareth » Thu May 12, 2011 10:15 am

In EViews 7 you can use:

Code: Select all

delete(noerr) t
In EViews 6, you're out of luck.

basil
Posts: 37
Joined: Thu Apr 28, 2011 11:48 am

Re: cleaning a table

Postby basil » Thu May 12, 2011 10:16 am

excellent; thank you.

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: cleaning a table

Postby tchaithonov » Thu May 12, 2011 10:40 am

Just do:

if @isobject("t")=1 then
delete t
endif

basil
Posts: 37
Joined: Thu Apr 28, 2011 11:48 am

Re: cleaning a table

Postby basil » Thu May 12, 2011 1:28 pm

thank you.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests