KEEP (Databank)

Examples

KEEP causes variables to be saved in the currently open TSP databank(s).

KEEP <list of variable names> ;

or

KEEP ALL ;

Usage

KEEP is followed by a list of variable names to be saved in the databank(s) named in the last OUT statement executed. It marks the variables for storage at that point in your program. Variables are automatically saved when they are changed or created (with GENR or SET statements, by matrix computations, or as the output of CAPITL, SAMA, etc.), but it may be convenient to specify explicitly the storing of such variables as equations. Any TSP variable may be named in a KEEP statement: including equations, constants, parameters, matrices, series, or models.

If you want to avoid cluttering up your databank with intermediate results or when you have errors in your run, store data by using an OUT statement followed by a KEEP statement explicitly naming everything you want stored at the very end of your run. Set MAXERR to zero, and TSP aborts before storing the data if it encounters any errors.

Supplying the keyword ALL forces all variables to be stored in any open databanks. Note that PROCs cannot be stored in a databank.

Output

KEEP produces no printed output. The variables named are placed in data storage with flags so they will be stored in the appropriate databank at the end of the TSP run.

Examples

OUT PDATA ;

FRML EQ1 Y1 = A1+B11*LNP1+B12*LNP2/(A1+G11*LNP1+G12*LNP2) ;

FRML EQ2 Y2 = A2+B12*LNP1+B22*LNP2/(A1+G12*LNP1+G22*LNP2) ;

PARAM A1 A2 B11 B12 B22 G11 G12 G22 ;

LSQ EQ1 EQ2 ;

KEEP EQ1 EQ2 A1 A2 B11 B12 B22 G11 G12 G22 ;

This example specifies and estimates a two-equation nonlinear least squares model and saves the equations and parameter estimates on the databank PDATA. Note that the LSQ statement causes the current parameter values to be stored automatically when it finishes, so that it is redundant to specify them on the KEEP statement. However, the equations EQ1 and EQ2 will not be stored unless you name them on a KEEP statement.

DOT US UK SW D ;

     OUT DB. ;

     KEEP GNP. CONS. P. DP. DW. U. ;

ENDDOT ;

This example shows how data can be placed in different databanks in one run. Identical databanks have been created to hold the series of each of four countries separately: DBUS (United States), DBUK (United Kingdom), DBSW (Sweden), and DBD (Germany). The same set of series is stored in each of the databanks using the KEEP statement.