G7 Commands: TΒΆ

tdates <date1> <date2>
tdates a
The tdates command sets the dates used by subsequent type (or print) commands.

For example, the command

tdates 1980.1 2010.4

means that the next type or print command will display quarterly data from the first quarter of 1980 until the fourth quarter of 2010. The tdates are set implicitly when you issue a type command with date arguments. They then are saved for the next type commands and not changed until you give another tdates or ty with date arguments.

tdates a

Selects “automatic” dates for graph and type commands. The automatic dates are the first and last date of the values actually present in the series. Automatic dates also adjust automatically to the frequency of the series.

Related Topics: Dates in G7, look, gdates, print, type

time
Display the date and time.
timer <on|off>
Calculates and display the length of time that passes between timer on and timer off commands.
(ti)tle <title for regression or graph>

Provides a main title that appears on subsequent graphs. Use ti with no following text string to remove the title. The title may be up to 90 characters in length. However, on graphs that might be too long. Note that titles can be passed as arguments when using the add or fadd command. In this case, the title must be enclosed within double quotes. Note that on graphs a subtitle command also may be given.

Related Topics: add, fadd, graph, regress, subtitle, vaxtitle

titpch [-<options>] [<stub_len>] [“str1” “str2” ..”strn”]

The titpch command defines a header line that will be provided for a regression table, and also defines the regression output that will be displayed on subsequent tpch commands. Before using either the titpch or tpch commands, an equation table punch file (.EQP) must first be opened using the eqpunch command.

The <stub_len> is a number that indicates how long the “stub” or title for the line should be. You should ensure that the width you specify in the tpch command is the same, so that the table will line up properly. See the example below for the tpch command.

The option string starts with a ‘-‘ character, and may contain one or more of the following:

b:rbar-squared
o:rho
r:r-squared
s:see
d:double-line format
f:floating point f format, instead of g format.
“str1”, “str2”, .., “strn”:
 strings to be printed to explain the coefficients. Therefore, “str1” might be “intercept”, “str2” is the second explanatory variable name, and so on.

Related Topics: eqpunch, tpch

tpch [<sur which>] <sector> [<”label”>] [str_len] [(coef numbers)]

The tpch command is the command that writes a line of an equation table file (.EQP). In order to use this command, a file first should have been opened using the eqpunch command and a header definition supplied by the titpch command. The command line arguments of this command are as follows:

[<sur which>]:is used only when an equation has been estimated with the stack or sur commands to that the coefficients are in rcoef1, rcoef2, etc.
<sector>:is the number of the sector or category for which the equation is estimated.
<”label”>:is a sector or category title in quotes. If used, you should also specify the length you want printed in the <str_len> argument
<str_len>:is the length of the sector or category label in the printout. Note that this should be equal to the “stub length” specified in the titpch command.
[(coef numbers)]:
 are used when there is a superset of regression parameters possible, and each equation uses some subset of that.

Example:

[eqpunch ven.eqp]

# Note: 30 is stub length.  Be sure to use the same for tpch!
titpch -rsf 30 const use usedif
add vena.reg   1 "Oilseed farming"
...
eqpunch off

[contents of vena.reg]

ti %1 %2
subti Inventory Change Regression
f usedif = use%1-use%1[1]
r ven%1 = use%1, usedif
#gr *
ipch ven %1 a
tpch %1 "%2"  30

Related Topics: eqpunch, titpch

try{...} catch{...}

The try command must be followed by the catch command. These routines loosely mimic similar routines in C++. Within the brackets following each command may be any collection of G7 routines, including other try-catch blocks. If execution of any of the commands within the try block produces an internal error signal, then execution of the code in the try block ceases and execution of the code in the catch block begins. Otherwise, the catch block is ignored. For example, consider the link series command ls. The routine will fail if the value of the guide series is zero in the base period. Ordinarily, this will cause G7 to stop execution of the script and report an error. If, on the other hand, the ls command is nested within a try block, then if an error occurs the alternative block of code following the catch command will be executed. In the following example, suppose that we prefer to use guide series y when it is available, and when it is not we rely on guide series z. We first try to extend series x using series y beginning in 2005, and if the value of y is zero in 2005, then we repeat the exercise to extend x using series z:

try{ ls x y 2005 f }
catch{
   try{ ls x z 2005 f }
   catch{
      ic Sorry.  No data in y or z.
      pause
      }
   }

The try-catch routine works well with many other commands, and it has a wide variety of useful applications. Note again that try-catch blocks can be nested, so that several alternatives can be tried before G7 gives up in despair.

(ty)pe <series_name> [<date1>] [<date2>]
(ty)pe (<expression>) [<date1>] [<date2>]
(pr)int
Displays values for the named series from <date1> to <date2> on the screen. The first number on each line is the date of the first observation on the line. Dates <date1> and <date2> may be omitted if they are unchanged from the previous type or tdates command. If the save command is on, then the displayed values are transferred to the save file where they are preceeded with an update command by default. The word update can be replaced by other commands, such as data, vdata, and various fix commands, by giving the appropriate word as the third argument of the save command.

If an expression is specified between parentheses, where the expression is in the standard f command or vf command syntax, then it will be evaluated. The results will be printed, but the results will not be stored to the workspace or default vam file.

If you are printing a lot of data to a file, then you might want to use the sty command which will save some time by not writing output to the screen.

Note that the formatting of the ty and sty commands can be changed with the format command; format controls the width, precision, and number of data points per line printed. This especially can be useful when printing data for reading with programs that read fixed width data fields.

Related Topics: addtype, format, save, stype, tdates

Previous topic

G7 Commands: S

Next topic

G7 Commands: U

This Page