G7 Commands: P

p123 <file_name> <date1> <date2> [width] [decs]
<ser1> [<ser2> <ser3> … <sern>] ;

p123 <file_name> <date1> <date2> [width] [decs] [<ser1> <ser2> … <sern>] ;
This command is similar to the matty command, except that the data are written directly to a Lotus worksheet. Do not include the WK1 extension with the filename; G7 automatically appends the extension WK1. <date1> and <date2> are the desired starting and ending dates. Up to 239 series names can be entered in free format. End the list with a ‘;’. Width and decs are optional; width specifies the display width within Lotus for all series transferred, decs specifies the number of decimals displayed. Default values are 9 and 3 respectively. p123 worksheets are compatible with Lotus 1-2-3, OpenOffice, older versions of Excel, and many other programs.

Example 1:

p123 natacct 60.1 91.1 8 1
   gnp c v vf vi fe fi g

Example 2:

p123 natacct 60.1 91.1 8 1 out(1-85)

Related Topics: Writing WK1 Files. matty, xl

pause [“<message>”]
pause [<seconds>]
The pause command instructs G7 to pause while processing the script. If no arguments are specified, or if a message (in quotes) is given, then the user is prompted to continue or to cancel the processing of the script. If a message is given, then the message is printed with the prompt. If a number, either integer or real, is specified, then G7 will pause for the given number of seconds before continuing.
pch <name> <number>

The pch command is an older form of the ipch command and is used to generate equation results for SlimForp style models. As with ipch, first an equation file is opened with the punch command, then, after doing a reression, pch is used to write lines to the equation file in the format expected by SlimForp.

Related Topics: ipch, punch

pmatin <matrix_name> <packed_matrix_filename>

The pmatin command introduces data for packed matrices to a Vam file. A Vam file already must have been assigned and set as the default Vam file. A packed matrix has all zero elements removed, and the format is efficient for presenting the nonzero cells of the matrix. The packed matrix data resides outside of the Vam file itself, and the Vam file contains only a pointer to the filename.

In the above syntax, <matrix_name> is the name of a matrix in the VAM.CFG file; it must have the letter ‘p’ in the “lags” position. The <packed_matrix_filename> is name the DOS name of the packed matrix file (these files always have the .PMX extension, but the .PMX should be included in the name.) The format of the data which follows is:

<year>
   <row> <num_non-zero_elements>
   <col1> <element1> <col2> <element2>  ...

For example:

pmatin bm bm.pmx
   1985
   1  5   # row 1 has 5 non-zero elements
   1  0.656  7 0.352  11 0.038   23 0.019  27 0.218
   3  2   # row 3 has 2 non-zero elements
   7  0.098  51 0.923
   ...

If the matrix is available for several years, the data for all years should be introduced with only one pmatin command, with each year’s data preceded by the number of the year. It is essential that the year numbers be in 4-digit format, i.e. use 1987 please, not 87. If a cell is non-zero in any year for which there is data, the packed matrix will have a place reserved for it in all years.

Related Topics: VAM.CFG File, matin, pmatin1, pmfile, pmpunch

pmatin1 <matrix_name> <packed_matrix_filename>

An alternative way of introducing data into packed matrices is the pmatin1 command. The format is just like that of the pmatin command, except that the data should be arranged in rectangular rows and columns like the matin command. For example, if you wish to treat as a packed matrix a 3 x 3 matrix known as B in the Vam file, you can introduce it with the pmatin1 command as follows:

pmatin1 B B.pmx
1995
    1  0  0
    5  0  1
    6  2  0
1996
    1.5 0  0
    6   0  2
    7   3  1

Note that in the above example, only those cells that are zero in all years will be left out of the packed matrix. Cell (3,3) actually will be stored since it has a non-zero value in 1996. As with the pmatin command, you should put the data for all years you want to read in the same file, and use only one pmatin1 command per matrix.

Related Topics: matin5, pmatin, pmfile

pmfile <matrix_name> <packed_matrix_filename>

The pmfile command associates a matrix name with a particular packed matrix file. This is useful when you need more than one version of a matrix. For example, one copy might hold coefficients, and the other copy hold flows. Or, suppose we wished to study the effects of changes in the A matrix and the A matrix was packed, then we would need two different .PMX files. If the original was called AM.PMX, then to create the alternative, say, AMALT.PMX, we would go to the DOS prompt via File | DOS and do:

copy am.pmx amalt.pmx
copy hist.vam vamalt.vam

Then from G7’s command box do:

vam vamalt b
dvam b
pmfile am amalt.pmx

This pmfile command will both assign AMALT.PMX to be used whenever the am matrix is referred to, and put AMALT.PMX into AMALT.VAM as the name of the file to be used for the packed am matrix.

Related Topics: pmatin, pmatin1, dvam, vam

pmmode { “simple”| “advanced” }

Note that the <packed_matrix_filename> setting is limited to 30 characters, including any path specification. Sometimes more than one vam bank is loaded in G7, where the vam banks include packed matrix files with the same name but that are stored in different locations. Sometimes it is not convenient to reset the link for each vam bank using the pmfile command, or perhaps inclusion of a full path specification would be needed to distinguish between the files but the full specification exceeds the limit of 30 characters. In such cases, it might be useful to specify a link to each packed matrix file relative to the placement of the corresponding vam bank. By default, G7 will assume that the packed matrix file is in the current working directory, or, if a relative path is specified, that the specification is relative to the current location. This behavior can be controlled with the pmmode command. The pmmode simple command corresponds to the default behavior. The “advanced” mode instructs G7 to attempt to find PMX files in the same location as the corresponding vam bank, or if a relative path is specified for the PMX file, the root location should be the location of the parent vam bank.

Related Topics: pmfile, vam

pmpunch <filename> <matname> [decs]

The non-zero elements of the matrix <matname> are written into the named file as input for the pmatin command. The <decs> argument gives the number of decimal places. The years written are determined by the current values of fdates. This command especially is useful for converting a rectangular matrix in a Vam file into a packed matrix. One writes it out as an ASCII file with this command and then reads it in with the pmatin command.

Related Topics: pmatin, punch, vp

psras [-f] <matrix> [r <group_exp>] [c <group_exp>] <rowcon> <colcon> [year] <r | c> [cnt]

This “proportional scaling” routine is another form of the ras command.. However, in the case where some of the matrix cells are negative, the proportional scaling changes all elements in the same proportion.

The procedure can be seen most easily by writing down what the \(X\) vector is after scaling, call this \(X^*\). This is determined in proportional scaling by the following equation:

\[x^{*}_{i} = x_{i} + \frac{ |x_{i}| }{ \sum |x_{i}| }\left( c - \sum x_{i} \right)\]

The intuition behind this scaling is that it preserves the proportion between the difference of the old and new valuesand the final scaled values. One of its strengths is that it is able to provide a result when for example, all the elements of \(X\) are negative, yet the control total is positive.

Related Topics: Ordinary RAS, ras, rdras

punch <punchfile | “off”>

The punch command is used to open up equation files for writing using the ipch command. These files usually have the extension .EQN, and are used in Interdyme models to construct an Equation object, which contains regression parameters, values of rho, equation types and other information for multisectoral regression equations. To close the file, use “punch off”.

The punch command usally is given at the beginning of a large regression add file. It often is useful to use the fadd command, along with an argument file that contains sector numbers, titles, equation types, starting dates, and other information that changes with each sector. Within the body of the fadd, a (r)egress command will be given followed by an ipch command. This will estimate the regression, and put the equation results into the equation file.

Related Topics: Interdyme, fadd, ipch, pch, regress, vp, zip

punch5 <filename> <vecname> [<field_width> <precision> <index_width>]
p5
This command prints a matrix or packed matrix to a file in punch5 format. The years that to be written are determined by the current value of fdates. Each year is written with a header that is a matin5 command, which tells matin5 also what <field_width>, <precision>, and <index_width> to use. (The <index_width> parameter is the width of the row and column numbers in the file.) Thus, a file created with punch5 can be read back into Vam using the matin5 command. This provides a convenient way to convert packed matrices into normal matrices. The punch5 format prints 5 non-zero matrix cells to a line, with row number, column number and cell value for each cell.

Related Topics: fdates, matin5

punchvec <filename> <vecname> <startyear> <endyear> [<field_width> <precision>]
pv
The punchvec command is used to print a vector to a file for all sectors for the years specified. The optional <field_width> and <precision> arguments again specify the field width and number of decimal places. The output file <filename> starts with a number of comment lines, telling the name of the vector, starting and ending years, and format information. Then one comment line gives the years as column headings. Each following line of the file contains the time series for one sector, with the name of the series, followed by the time series of data.

Related Topics: vp

pwd

The pwd command prints the path of the current working directory.

Related Topics: cd