G7 Commands: GΒΆ

gdates <gdate1> <gdate2> [gdate3]
gdates automatic
Sets the dates used by subsequent graph (or plot) commands. With two dates provided, the series will be graphed from <gdate1> to <gdate2>. If a third date is given, the series will be graphed from <gdate1> to <gdate3>, with a vertical line drawn at <gdate2>.

“gdates a” selects “automatic” dates for graph and type 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.

Related Topics: Dates in G7, fdates, look, tdates

getsum <matrix> <r|c> [<group>] <vector>
Get the sum of the rows or columns of a given matrix for the range of periods specified by the fdates. The first argument must be the matrix or vector for which we want to obtain the sums. The matrix is assumed to be stored in the default vam file unless a bank letter is provided. The second argument must be ‘r’ or ‘c’ (to obtain the sum by rows or by columns). If only a partial sum is desired, then the columns or rows are specified next. The last argument is the vector where the result is to be stored; this vector must be located in the default vam file.


getsum amf c intcol

This example puts the column sum of the A-matrix in flows (“amf”) into the vector intcol.

The sum is calculated and stored for all the years in the Vam file so that we cannot have mixed information in the target vector.

Related Topics: coef, flow

glist <groupname>
This command lists the sectors in a group. The <groupname> specifies the group name. For named groups to be available, there must be a GROUPS.BIN file in the current directory, created by the G7 or by the Fixer program. (See the Fixer documentation for more on how to create named groups.) Otherwise, there is one dynamic group, named ”:”, which is available after using the group command.


group 19-25 (20 22)

The name of this dynamic group is ”:”. The names and content of the static groups defined in Fixer or with the G7 group command are preceded by a : in commands that use groups. After the above group command, the command:

glist :

would give:

19 21 23 24 25

Related Topics: group, listgroups

(gn)ame <prefix> <number>
In working with multisectoral models, it is common to have add files that draw graphs for many sectors. In this case, the gname can get a series of graphs started with a name and number, as follows::
gname out 1

The name of the save file for the first graph drawn will then be OUT1.WMF, for the second OUT2.WMF, and so on. Note that the numbers increase with each graph drawn whether or not it is saved.

Related Topics: Drawing Graphs, gsave

Print the displayed graph to the currently assigned default printer. This command is useful when you would like to print a large number of graphs without user intervention. Set up the default printer setup with Graph | Printer setup, then use gprint to print each graph in turn.
Related Topics: Drawing Graphs
(gr)aph <name1> [<name2>] [<name3>] ... [<name7>] <date1> <date2> [date3]
(gr)aph (<name1>) [(<name2>)] [(<name3>)] ... [(<name7>)] <date1> <date2> [date3]
Constructs a standard Line Graph. Graph the named series from <date1> to <date2> or <date3>, if present. If <date3> is present, a vertical line (to separate history from forecast) will appear at <date2>. If dates have not changed since the last graph command, they need not be repeated. After a regression, the actual and predicted values may be plotted by gr *. The actual data will be marked by squares and the predicted by plusses, unless the marks have been changed by a previous line command. Algebraic expressions may be provided in place of some or all of the series names, so long as the expressions are enclosed in parentheses.


title RTB -- The Treasury Bill Rate
gr rtb 70.1 85.1

Related Topics: Dates in G7, Drawing Graphs in G7, Printer, autoprint, hrange, legend, lgraph, line, look, mgraph, sgraph, subtitle, title, vrange, vaxlab, vaxtitle

(gridty)pe [file <filename> ] [<date1> <date2>] <ser1> [ <dp1> ...<seriesN> <dpN> ] ;
This command displays a scrollable spreadsheet, or grid, in a new window. Each column holds a variable, and each row shows a separate date. Column and row headings are also included. The grid display is convenient for scrolling around to look at the data. One also can copy data from the grid display to the Windows clipboard. If the optional “file <filename>” part of the command is given, the results are written to an output file, exactly as with matty. The dates are optional. If none are given, then default values are determined by the current tdates. After each series name there is an optional “decimal places” number (<dp1> ... <dpN>). Each series can be specified to have a different number of decimal places. If not specified, the default value of 3 is employed, unless the decs or format command has been given to specify a different default. If a value for <dp> is given for one series, it will be in effect for all of the other series in the list.


# GRIDTY.TST - Test the operation of the "gridty" command.
hbk quip
gridty gnp c v;

Related Topics: matty, show

(gro)up <group definition>
Define the content of the dynamic group. A group definition works as follows. Any list of numbers separated by blanks or commas may be included. Two numbers joined by a dash (‘-‘) indicate a consecutive range of numbers to be included. A group definition within a group definition, enclosed by parenthesis indicates a group of sectors to be excluded from the overall group.

For example:

group 1-10 (4, 7-9)

Indicates a group consisting of the numbers (1,2,3,5,6,10). The name of a group created by the group command in G7 is :. This name is used in the various commands that may use groups. These commands may also use named groups, if they have been created in a GROUPS.BIN file by the Fixer program.

Related Topics: Groups, ctrl, glist, index, lint, listgroups

group <group name>
<group definition>
This version of the group command adds a named group to the GROUPS.BIN file. This group then can be used in other commands requiring group expressions by prefixing the group name with a colon ‘:’. The group definition include a sequence of integers, a range of integers, a set of letters to specify spreadsheet columns, and other named groups. To exclude a set of values from the group definition, simply include the set to be excluded in parentheses.

For example:

group Manufacturing   # All manufacturing sectors
f empmfg = @csum(emp, :Manufacturing)
group NonchemicalMfg  # All manufacturing sectors except chemicals
:Manufacturing (20-27)
(gs)ave <filename>
Save the current graph to a Windows Metafile. Only give the rootname of the file in <filename>, the extension .WMF will be automatically appended. The file will be saved to the current directory unless you supply a full path name.
Related Topics: Drawing Graphs, gname, listgroups
(gtf)ile <stubfile | “off”>
The gtfile command scans the specified stub file and stores the starting position of each line in the stub file. This command is used only in preparation for giving a sequence of gtitle commands. The titles from the stub file that just has been scanned now are available to be used as titles, as specified by gtitle. To close the gtfile command, give “gtfile off”.
Related Topics: gtitle
(gti)tle <n>
This command requires that a gtfile command has been given with a valid stub file as an argument. The gtitle command then will use the n-th line of the stub file to take a title in the following graph command. (The title will be the text after the semicolon (‘;’) in the stub file.) These commands, gtfile and gtitle, particularly are handy in combination with the do command or with an add file with group arguments. Since in these cases only sector numbers are being passed, the gtitle command allows you to specify a sector number and get back the title for that sector.
Related Topics: gtfile

Previous topic

G7 Commands: F

Next topic

G7 Commands: H

This Page