G7 Commands: D

data <name>
<date> <observation1> ... <observationN>
The data command introduces data into the workspace data bank. There are two forms the command can take.

Form 1:

data sales
  83.1  34.0 56.8 44.5 55.6
  84.1  39.3 41.2 43.9 47.0 ;

The first number on each line is the date of the first observation on that line. Input is terminated by a ”;”. The ”;” may be omitted in an add file except on the last line of the file.

Form 2:

data sales 83.1
  34.0 56.8 44.5 55.6
  39.3 41.2 43.9 47.0 ;

The date of the first observation is given on the command line immediately after the series name. No dates appear on subsequent lines.

Form 1 is easiest if the data is being entered by hand. Form 2 is easier if the data is generated by a program.

Input data may contain floating point numbers in exponential form. Thus, the number 3 may be represented as 3.0, 3.0E+00, 0.300E+01, or 30E-01. Only E, not e, is recognized in this context. Any number of spaces between data observations is allowed (the data are free format).

A missing value may be represented by a single question mark (? ). Therefore

data sales
   83.1  34.0 ? 44.5 55.6

indicate that the sales for 83.2 quarter is missing.

Related Topics: frequency, matdata, update, vdata

del <series name> [<series name2> [...]]

Delete the named series from the workspace data bank. The last series is moved to the place of the deleted series. The workspace bank file is not physically reduced in size by a deletion, but if another variable is added to it after the deletion, it will be put in the space formerly occupied by the deleted variable. One or more series may be specified for deletion.

Related Topics: rename

dfr <bank_name> <bank_location>

The dfr command is used to assign a Dirfor file as a G7 assigned bank. Dirfor files are files containing forecast results and historical data from a run of the Inforum LIFT model, or from one of the family of SlimForp international models. (SlimForp is the predecessor to Interdyme.)

These Dirfor files have a format described by a DIRFOR.DAT, or DIRFOR.CRD file. After assigning a Dirfor file with this command, you will be asked to provide the name of the appropriate DIRFOR.DAT file. Note that the DIRFOR.DAT file must point to the appropriate DIRHIS.DHS history file, as well as a correct MACRONAM.BIN list of macrovariable names. The series names for G7 will be formed by the concept name in the DIRFOR.DAT file, joined with the sector or category number.

Related Topics: Assigned Banks, bank, cbk, hbk, listbanks, vam

dfreq [0|1|2|4|6|12]

The dfreq command sets a default frequency for the left-hand side variable of an f command, when the right hand side does not have a frequency. The default is 0, which means no frequency. Otherwise, frequencies are determined by the frequencies of the series on the right hand side of the f command.

Related Topics: frequency

(diage)xtract <matrix_name> <vector_name)

This command takes the diagonal elements from the matrix and inserts them into the vector. The vector and the matrix must be of the same dimension, and the matrix must be square. One common use of this command is when you want to use the index command to move the A-matrix coefficients forward in time, excluding the diagonal. In this case, extract the diagonal to a scratch vector, do the coefficient indexing, and then insert the diagonal back again.

Example:

fdates 1998 2020
diagextract am z     # am is the A-matrix; z is a scratch vector
index 1998 mover am  # mover is a vector of coefficient change indexes
diaginsert am z

Related Topics: diaginsert, index

(diagi)nsert <matrix_name> <vector_name>

This command is just the reverse of diagextract. It inserts the elements of the vector into the diagonal of the matrix.

Related Topics: diagextract, index

dir [arguments]

The dir command prints the contents of the current working directory. The arguments are legal DOS arguments for the system dir command. Note, however, that any ‘#’ characters are interpreted as the G7 comment delimiter, and so any text after ‘#’ is ignored.

Example:

dir t*.* # This command displays all files beginning with 't'.

Note that the /p option will not function properly, because at present there is no means for the G7 user to interact with the operating system in this case (where the user is prompted to hit a key after every page). Because the G7 window may be scrolled, the /p option is probably not needed. If necessary, the following G7 commands will allow use of the option, but the results will not appear in the G7 output window.

dos –i {dir t*.* /p; pause}
dos –I dir t*.* & pause
do{ <G7 commands with variables> }[<Arguments>]

A do command allows you to run a set of G7 commands like an add command without actually creating an add file. Argument substitution is done just as in add files, where variables are %1, %2, etc. A do command can continue on several lines. However, the arguments should be placed on the same line as the closing brace mark ‘}’. As with the add command, no more than 99 arguments are allowed, and the last two arguments may be groups.

Example 1:

do{ gr out%1 65 97 }(1-87)  # graph output of sectors 1 through 87

Example 2:

The do loop can also make use of an if test in the loop. Useful examples of the need for this capability would be: 1) special operations needing to be performed for particular industries; or 2) report displayed for particular iterations. In this example, we iterate over values 1 to 10, and display the iteration numbers 1-3, 5, and 10.

do{
   if( %1 < 3 || %1 == 5 || %1 == 10){
      ic Iteration %1
      }
   }(1-10)

Related Topics: Command Files, Groups, add, addtype, function

dos [<dos command>]
dos [<options>] [<batch file arguments>] <{...}>
The dos command allows the passing of a DOS command to a temporary DOS shell. Batch files can also be run. When the DOS shell starts, you will see its output in the G7 output window. If the dos command is given with no arguments, then a DOS command window will open, and will remain open until you type exit.

Example:

dos runmodel.bat

To pass a group of commands to DOS, use the dos{} command. The braces tell G7 to create a temporary batch file containing the dos commands between the braces. The temporary file is destroyed automatically upon completion. Arguments may be passed to the batch file by listing them after the dos and before the opening brace. Here is an example that copies a workspace bank to another bank:

dos ws newws {
   rem Copying bank %1 to %2
   copy %1.ind %2.ind
   copy %1.bnk %2.bnk
   }

When this dos command is given, the three lines after the opening brace are written to a temporary batch file, and then that batch file is called with the arguments “ws” and “newws”, which replace “%1” and “%2” in the batch file, respectively. The output of the batch file is written to the G7 output window. If you would like to run DOS commands in interactive mode (e.g. when user input is required), use the “-i” option. For example:

dos –i idbuild master

opens a command window and executes the program IdBuild with master as a command line argument. If IdBuild requires user input, the user will see the prompt in the DOS window and can enter a response. The same option is available in batch mode (using the braces.)

(dv)am <bank_letter>

This command sets the default Vam file. G7 can have many banks open at once, and some of these may be Vam files. Most commands that involve using vectors or matrices in a Vam file will operate on the default Vam file. Each bank is opened at a different bank letter position, and that is that bank letter that should be given with this command. A Vam file already must have been assigned as a bank before it can be made the default. However, if several Vam files are assigned, the default can be switched from one to another as often as is needed.

Example:

vamcr vam.cfg hist # Create hist.vam with VAM.CFG as configuration file
vam hist b         # Assign hist.vam in position "b"
dvam b             # Make hist.vam the default vam file

Related Topics: VAM.CFG file, pmfile, vam, vamcr, vf, vup

Previous topic

G7 Commands: C

Next topic

G7 Commands: E

This Page