Dates and Frequencies

Dates in G7 either can be 4-digit or 2-digit, but 4-digit dates allow G7 to work more reliably. A date is indicated by a year, followed by an optional decimal point, and a “period” that is used with quarterly or monthly data. For example, “83” or “83.0” or “1983” all refer to the year 1983. With annual data, the period either is “0” or should be left off. Note that when using “2-digit” dates, the year 2000 should be represented by “100”, and the year 2010 by “110”.

Quarterly data is indicated by a date with 1 digit after the decimal point, from 1 to 4. Thus, “2010.1” and “2010.4” refer to the first and fourth quarters of 2010.

Monthly data is indicated by three digits after the decimal point, from 001 to 012. For example, “2010.001” is January 2010 and 2010.012 is December 2010.

Note: if gnp is a quarterly series, the command

type gnp 1965 2010

will NOT print gnp for the years 1965 to 2010, but return the error message “Dates do not match frequency of variable.” The correct command is

type gnp 1965.1 2010.4
freq <series name> [frequency]
Displays a series’ frequency and allows you to change it. The series and its new frequency will be put into the workspace bank. Note that this is true even if the series originally was in an assigned bank. (See the topic “Assigned Banks” for more information on data banks. See the function list for functions in G7 that will change the frequency of data, performing conversions from quarterly to annual and back, etc..)
dfreq [0|1|2|4|6|12]
Set a default frequency for the left-hand side variable of an f commands when the right-hand side does not have a frequency. The default is 0, or no frequency.
fdates [date1 [date2]]
fdates off
fdates [<±><n1> <±><n2>]
Sets or resets the dates used by subsequent f commands. When an fdate command is issued, it defines the time period in which subsequent f commands act. For a series that exists in the workspace or in the assigned bank, it modifies the value within that period without affecting the existing values outside of the period, and it puts the series into the workspace. Otherwise, it creates a series, sets the values from the right-hand side of the f command within the specified period, and sets missing values, that is, -0.000001, for those outside the period. “Off” resets the fdates to the default.

Example:

fdates 1980.1 2010.4

In this case, subsequent f commands only alter the value of a series between the first quarter of 1980 through the last quarter of 2010.

The default fdates are implicitly defined in G.CFG: “fdate1” is the first period of the “Default base year of workspace file” as defined in G.CFG, “fdate2” is the period implied by “Default maximum number of observations per series in workspace” in G.CFG.

Example:

fdates +1 -2

This example adjusts the fdates setting. If fdates previously were set to 1980.1 to 2010.4, then the adjusted range spans 1980.2 to 2010.2.

tdates <date1> <date2>
Sets the dates used by subsequent (ty)pe (or (pr)int) commands.

The command

tdates 1980.1 2010.4

means that the next (ty)pe or (pr)int command will display quarterly data from the first quarter of 1980 until the fourth quarter of 2010.

gdates<date1> <date2> [date3]
Sets the dates used by subsequent (gr)aph (or (pl)ot) commands. With two dates provided, the series will be graphed from “date1” to “date2”. If a third date is given, the series will be graphed from “date1” to “date3”, with a vertical line drawn at “date2”.
gdates a
tdates a
Selects “automatic” dates for (gr)aph and (ty)pe commands. The automatic dates are the first and last date of the series actually present. The default setting in look is for automatic dates, unless specific dates previously have been specified. Automatic dates also adjust automatically to the frequency of the series. This feature is not to be trusted when more than one series is being placed on the same graph.

Previous topic

G7 Commands and Scripts

Next topic

Forming Variables

This Page