The Workspace Bank: Making, Compressing, and Splicing BanksΒΆ

At any one time, G7 has one workspace bank and 0 to 25 assigned banks. The workspace bank is the same physical bank throughout any one run of G7 unless it is changed using the wsbank command explained below. Whenever G7 needs a series, it looks first in the workspace and then, only if it does not find the variable there, it looks through the assigned banks. The original assigned bank, at position ‘a’, is specified in the G.CFG file that is read when the program starts. Additional banks may be loaded, replacing the bank in the ‘a’ slot or assigned to other positions. As G7 forms variables with f commands or introduces variables with data commands, the newly created or introduced series are put into the workspace bank. Even the update and mupdate commands do not change the series in the assigned bank but put the revised series into the workspace.

(lis)tnames [-srgv] <w | assigned> [wildcard]
lnc [-srgv] <w | a> [wildcard]
Types the names of the variables in the workspace (w) or assigned bank (a), where “a” is any letter between ‘a’ and ‘z’ except ‘w’. If the save command is on, the list will then appear both on the screen and in the saved file. Use of wildcard is optional, and like in DOS, ‘*’ will match any number of characters. For any single character, however, you need to use ‘^’, instead of ‘?’ as in DOS. The lnc routine is identical to listnames but prints the series as a single column. Option ‘s’ sorts the series in alphabetical order, and ‘r’ reverses the order. If a Vam file is associated with the G bank, then option ‘g’ prints only macro series and option ‘v’ prints only Vam bank series.
(bti)tle <w | assigned> [bank title]
Displays the title and configuration of the workspace (w) or assigned bank (‘a’ through ‘z’ except ‘w’). In the case of the workspace, you can supply a new title or change the existing one. It is useful to record the time and date of creation of data banks. This can be achieved easily by using the keywords “%time” and “%date” in the title. G7 will replace these keywords with the actual time and date, respectively. This capability also can be used elsewhere in G7, including in the vtitle and ic commands.
(wsb)ank <bank_name>
This makes the named bank the workspace. The bank name is expressed as in the bank command, above. Beware: the workspace now becomes the named bank and this bank will be changed by almost anything you do. In particular, a zap command (see below) will destroy the bank completely. Use this command with utmost caution. It is best to back up a bank before using it with this command.
This command prints information to the screen about the current workspace bank, including its bank title, the number of series in the bank, the maximum number of observations per series, and the default starting year (base year) and period.
wscache <on|off>
wscache <yes|no>
When on, reading and writing to the standard workspace (WS.*) is suspended and data are held in memory. When first turned on, data are read from WS.*, and when turned off data are written to WS.*. Capacity in memory is greater than on disk because of known limitations of the GBanks design, and so pushing data from memory to disk will fail if the WS.* bank capacity is exceeded. In some cases, script processing speed may increase dramatically with use of this routine.
wsdump <filename> [<”tdates”>]
This routine will dump data from the cache to a text file. Data may be printed according to the current tdates if the <”tdates”> option is specified. Otherwise, the routine will strip from the series any leading and trailing zeros, missing values, and garbage, and it only will print data that appear to be valid. This text file may be employed with Banker to compile compressed banks.
zap [<baseyr>[<starting period> [<nobservations>]]]
Sets the number of series in the workspace to zero. Arguments after zap override those in the G.CFG file. “baseyr” overrides the line “Default base year of workspace.” “starting period” overrides the line “First month covered.” “nobservations” overrides the line “Default maximum number of observations per series.”
del <series_name>
Delete the named series from the workspace data bank. The WS.BNK file physically is not 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.
(ren)ame <old_name> <new_name>
Changes the name of a series in the workspace bank.
(bu)pdate <x> = <y>
bupdate stands for bank update. This command takes the series x from the workspace, updates it with non-zero entries from series y, and stores it as x in the workspace. If x is not already in the workspace, bup will put it there with values from the assigned bank. “y” may be an expression.

Previous topic

Assigned Data Banks

Next topic

G7 Commands and Scripts

This Page