Running G7 Commands in Batch (Add files)¶
A powerful feature of G7 is the ability to do a long sequence of commands in batch mode, much like a program. The commands are stored in text files we call add files. G7 add files typically have certain file extensions to indicate their purpose. The “.ADD” extension is the most common, and ti indicates a file containing a sequence of G7 commands for data manipulation or preparation. The “.SH” extension is a show file for presenting a visual show of data for analysis. Finally, the “.REG” extension commonly is used for regression files. However, you are free to name the files with any extension you like.
The nipaq bank comes with a show file called NIPAQ.SH. You can run it in G7 using the add command.
add nipaq.sh
Alternative methods for executing add files include:
Pick the menu item File | Execute, and then choose the file NIPAQ.SH.
Click on the “Run Add File” button , and then pick the file NIPAQ.SH.
This NIPAQ.SH file demos the capabilities of G7 and also plots some of the series in the nipaq bank.
If an add file has many graphs, after each graph in the add file the add file control panel will appear. This panel is shown below.
You continue to execute the add file by clicking the Cont. button, and you stop the add file clicking the Stop button. Here are explanations for the other buttons.
- Max:
maximizes the graph to full screen.
- Normal:
puts it in its place in the bottom right hand corner.
- Save:
puts the graph into a file that can be included in other documents.
- Print:
sends a copy of the graph to your printer.
- Shift1:
- Shift2:
buttons allow you to view more than one graph at a time. There are two positions above the default graph position that the graph can be copied to if you click Shift1 or Shift2.
- Zip:
continue to process the file without stoping to display each graph.
The default button on the add file control panel always is the last button clicked, and the default button can be clicked by pressing the space bar or the [Enter] key. Once you have clicked Cont. the first time, you can move through the entire add file by tapping the space bar.
In most cases, an add file will direct G7 to act as if you had typed the commands in line by line in the command box, but there are a few multi-line commands that must be executed from within an add file. See the G7 Reference Manual and the G7 Help file for more details.