To preserve the greatest amount of flexibility and ensure the greatest long-term ease of maintenance, the best option is adding your existing source code to a new AcuBench program. This option provides you with access to all of the AcuBench code generation and automation tools, and after the initial investment of time, requires the least amount of manual intervention to maintain and add to your code going forward. If you are using AcuBench as part of a legacy modernization process that involves increased use of graphical user interfaces and/or graphical reports, the ease with which you can add and update graphical features to an AcuBench program will likely render this initial investment well worthwhile.
In preparation for this process, the first thing to understand is how AcuBench generates code, and specifically how AcuBench uses program tags (discussed in section Program Tag Options) to determine where to generate code. These program tags act as cues, telling AcuBench where to place different sections of a COBOL program. They are also used to indicate insertion points, at which the code that you define in the AcuBench graphical designers is placed. To understand how to bring your existing code into a new AcuBench program, you must understand where to place your code, so that it can be integrated into the generated program.
As with every method of working with AcuBench, the process starts with data. When you bring your FD and SELECT statements into the File Designer, the IO Handling interface provides a central repository for storing the file handling code associated with a specific data file.
Specific methods for bringing your data definitions into AcuBench are discussed in Working with Data at the Project Level.
Before creating the AcuBench program, think about how code will be generated for the program. Do you want code to be generated into a single source file or split into multiple COPY files (the default)? Which program tags will you need? Study the Code Generator section of the Tools > Options interface, as described in Customize Your Working Environment, and set the code generation rules that best apply to your practices.
Chapter Working with Programs provides an overview of the program creation process, including information about the program properties that you can customize and control.
Data sets are used to specify how the data defined in project-level data layout files are used by an individual program. When you define a data set, you determine what file handling code is generated (OPEN, READ, DELETE, CLOSE), which key (if applicable) is used to start the file, and so on. In addition, data defined in data sets is exposed to the various AcuBench graphical designers, making it easier to create screens and reports, for example.
The process of defining data sets is described in Working with Data at the Program Level.
By default, once a program contains screens and reports, AcuBench performs an automatic check to verify that the variables used by those screens and reports have been defined within the program. If AcuBench cannot locate those data definitions, it adds them to the graphical Working-Storage Designer. To correct problems with duplicate names, it is a good idea to bring your existing Working-Storage data definitions into the graphical designer before adding screens or other code.
You can use either of the following methods to bring your Working-Storage code into AcuBench:
The Working-Storage Designer interface is described in Working with Data at the Program Level and Using the Working-Storage and Linkage Editors.
Note that, by default, AcuBench generates Key-Status definitions for all generated programs. If your Working-Storage section contains Key-Status definitions, you can either disable the automatic generation of Key-Status code or add your definitions to the AcuBench interface used to generate this code. These Key-Status options are discussed in section Key-Status.
The last two sections of this chapter discuss the process of importing existing character-based and graphical screens into AcuBench. These import utilities provide a starting point for working with existing screens in the graphical Screen Designer.
As you begin to work in the Screen Designer, keep in mind the following points:
The Screen Designer and Event Editor discussed in chapter Working with Screens.
As discussed in Step 5, the Event Editor is both used for event, exception, and termination procedures, and to access insertion points in the generated code. Each of these insertion points is associated with a program tag, making them relatively easy to identify when stepping through the code in the debugger.
It is difficult to offer general rules for how to determine which pieces of code go where. The better you understand AcuBench’s code generation rules, and the program tags that the code generator uses to identify and place code within the code skeleton, the more straightforward the process will be.