FAQ #: 43
What is a "switch"? How to use an Optional Program Switch?


No doubt, at some point, you have heard us say "program switch", or you have read about an "optional program switch" in the manual or the on-line.

Optional program "switches" are ways that we have of changing how a program works, or allowing the program to perform some optional feature. The majority of the options that are available in any Answers program are available by selecting that feature, or changing the option, through the Answers Configuration program. However, there are some features and options that are not available as configuration options. Most of the time, these options are either rarely used, or using them could cause serious problems or invalidate the answers data. Before using an optional program switch, always read the program documentation carefully to understand what the switch will do.

Switches can be applied to programs in one of two ways. A "one-time" only switch allows you to run the program invoking the special feature or mode, and then once you exit from the program, it will go back to it's normal actions. To use the switch in this manner, you will run the program from the Execute A Cobol Program prompt. You will need to know the name of the program and the optional switch. You should be able to locate the name of the program and the switch in the Answers manual. Enter the name of the program and the switch in the format ProgName/X where X is the switch letter, number, or symbol. The program will run with the special switch for that one instance.

To add a switch permanently, you must edit the menu using the Menu File Maintenance program. Once you have displayed the appropriate menu in the menu file maintenance program, change the "call name" to be the program name followed by the switch, using the format ProgName/X where X is the switch letter, number, or symbol. Modifying the menu will mean that each time that program is run, the switch will be invoked so that the optional feature or mode will be available.