|
<< Click to Display Table of Contents >> DELETE |
![]() ![]()
|
DELETE is used to remove variables from databanks.
When deleting timeseries, remember that default DELETE only deletes series of the currently active frequency from the first-position databank. You may use : and ! to broaden this, for instance delete b1:*!*; deletes all timeseries of all frequencies in the b1 databank (this will only work if the databank is editable, cf. UNLOCK).
delete variables;
delete < NONMODEL > ;
NONMODEL |
Removes superfluous timeseries in the first-position and Ref (reference) databanks (provided a model has been defined with MODEL). The removal is only done for series of the same frequency as the global frequency setting. For instance, you might have a databank and model variable y for income. Now, imagine that the definition and contents of the variable is changed to y2 in both the databank and model. If the old variable y still resides in the databank, this may create confusion, and the NONMODEL option removes such non-model variables. Cf. also the Gekko menu Utilities --> Compare model/databank/varlist....
|
variables |
Besides normal variables, the variables may also be array-series elements like x[a,b] or x[a,*], or more complex wildcards like x[a,b*c?d]. |
•If a variable is stated without databank, the databank is assumed to be the first-position databank.
•Note that 'naked' wildcards are allowed in this statement, so you may for instance use a*b?c as wildcard instead of the more cumbersome {'a*b?c'}.
•Looping: with a list like for instance #m = a, b;, you may use delete x{#m}; to delete xa and xb.
Delete a series x, a string %x, and a list #x:
x = 100; |
If, instead, you want to delete the series corresponding to the contents of %x and #x, use {}-curlies:
a = 100; |
You may use wildcards like in COPY, INDEX, RENAME, etc.:
delete **; |
This will delete all variables from the first-position databank. Alternatively (and better):
clear first; //or clear work, if Work is the first-position databank |
Another example:
delete x*!q; |
This will delete all quarterly series starting with x. You may also delete a variable from a particular databank (provided that bank is opened with OPEN<edit> or unlocked with UNLOCK), for instance:
delete bank2:x1!q; |
Remove non-model variables with this special option:
delete <nonmodel>; |
To clear the entire workspace, including databanks, list, scalars, models, etc., see RESTART or RESET. To delete the contents of databanks, see CLEAR.
CLEAR, CLOSEALL, INDEX, RESET, RESTART, UNLOCK