Using Application ServerNext

Chapter 1: Developing COBOL Applications

Server Express provides everything you need to develop COBOL applications to run on UNIX systems. It also provides for problem-free migration of COBOL applications from a large number of other systems and dialects, including IBM mainframe COBOL, and UNIX systems. Before reading this chapter you should have read your Getting Started, which tells you how to install the COBOL system and gives a brief overview of using it.

This chapter gives an overview of the steps required to create executable files from COBOL source code, and the tools available to help you develop applications. If you want to create object oriented COBOL programs, you need additional information; refer to your OO Programming with Object COBOL book for details. If you are working in 64-bit mode, you should refer to the chapter Working in 32-bit and 64-bit Modes

1.1 The Development Cycle

The basic steps in creating an application are:

  1. Create and/or edit programs

  2. Check the syntax of your program

  3. Debug your program

  4. Recycle through steps 2 to 3 until you are happy with the program

  5. Compile your program to an executable format

  6. Ship your application to your end-user

You can debug your program at any stage in the application development cycle. Although you typically debug applications during application development in the edit-compile-debug cycle (steps 1 to 3 above), you can debug an executable program at any time, using the various debug facilities available in Server Express. This enables you to easily correct and maintain programs once they have gone into a user's environment.

Server Express provides tools and utilities to help you develop COBOL programs and applications. These are described in the following sections.

1.1.1 Creating and Editing Programs

Creating and editing programs is one of the most basic functions you need when writing applications.

You can edit your programs using the Editor. The Editor is described in detail in the chapter Editor in your Utilities Handbook. Alternatively, you can edit programs using system editors, such as vi.

1.1.2 Checking the Syntax of Your Program

Before you can debug your program, you must check its syntax. Syntax-checking is the first phase of compilation.

The syntax-check creates:

These files can be used by Animator when debugging a program.

You check the syntax of your program using the cob command. See the chapters Creating Programs, Using the Compiler and COBOL System Interface (Cob) for details on compiling and the cob command.

You can also check the syntax of your program from the Editor. The Editor calls the Compiler to check the syntax of a program. If the Compiler finds a syntax error it displays a message. When the syntax check is complete, the Editor returns to the editing screen and positions the cursor in the first error it found. When you have fixed the error you can move the cursor to the next error. See the Editor chapter in your Utilities Handbook for details.

1.1.3 Debugging Your Program

Server Express provides Animator with which you can debug your programs. Animator offers a comprehensive debugging environment.

Animator shows you both the source code of your programs as they are running and the effect of each statement as it is executed. Debugging using Animator is also referred to as "animating".

When you debug a program using Animator you can:

To learn how to use Animator, follow the sample session described in your Getting Started. You can use Animator very effectively by knowing how to use the basic functions:

Step
Perform Step
Perform Exit
Breakpoint Set
Zoom
View
Locate
Query
Monitor (on the Query menu)

When you are familiar with these and with using Animator, you should become familiar with the following additional functions:

Breakpoint Do
Do statement
Reset Quit
Split Text
Breakpoint If

For detailed information on using Animator, see your Debugging Handbook.

1.1.4 Compiling Your Program

When you have debugged your program you need to compile it to create an executable file format (the types of executable file are described in the section Executable File Types in the chapter Packaging Applications). For more details on how to create programs in particular executable formats, see the chapter Creating Programs.

1.2 Packaging Applications

Server Express offers alternative methods for packaging applications; each method has its advantages and disadvantages. The methods used to package applications are described in detail in the chapter Packaging Applications. You can package applications by:

1.3 Running Your Application

When you have packaged an application using one of the methods described earlier in this chapter, you can run the application. An application can be run by typing the name of the system executable file at the command line. For example, if you have linked your application to create a system executable file myprog, this could be run by typing:

myprog

at the command line.

If your program reads the command line using an ACCEPT ... FROM COMMAND-LINE statement, enter the required command following the name. For example:

myprog in-file new-file

If your application is built using callable shared objects, or intermediate or generated code files, you might need to use the cobrun trigger. For example:

cobrun myprog

or, if the programs are multi-threaded:

cobrun_t myprog

For information on multi-threaded programming see your Multi-threaded Programming book. For information on run-time triggers, see the chapter Running in this book.

1.4 Shipping Applications

When you have created and tested your application, you can, if necessary, ship it to your end-users. To ship an application, you need to ship all of the executable programs that make up your application, along with any configuration files and data files. You also need to ship Application Server, which contains all of the Micro Focus Server Express system files required by the application.

See the chapter Using Application Server for information on Application Server.

1.5 For More Information

For more information, see the following chapters:

and the following books:

The chapter Sample Session in your Getting Started guides you through the development process using a tutorial.


Copyright © 2000 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

Using Application ServerNext