Completing and Running Your Windows GUI Application | Windows Tips |
You use the UNIX Option to deploy applications developed on NetExpress to UNIX systems.
You need to have read the chapter Start Here for the Tutorials and worked through the first session, Using NetExpress, before you do this session.
You use the UNIX Option to deploy an application that you have created on NetExpress to a UNIX system that has Micro Focus COBOL for UNIX V3.1 or later installed.
In this sample session we start with an existing COBOL application. When you deploy the application on the UNIX system using the UNIX Option, the application is rebuilt on UNIX and you run it there. This sample application consists of just one COBOL program, which simply creates a one-record output file.
To see how to deploy a Web application on UNIX, after finishing this book you should see the online book Internet Applications.
You cannot deploy a Windows GUI application, such as is created using Dialog System, on UNIX. However, the UNIX Option includes a character version of Dialog System for creating character user interfaces; this is described in the Dialog System Character Mode User Guide.
Before you can run this session you must have the Server Control Program (SCP) installed on your UNIX system. It is needed for the Publish function of UNIX Option to work. SCP is supplied on the NetExpress CD. For instructions on installing it, see the appendix Installing SCP and Samba in the UNIX Option User Guide.
You must have a connection to your UNIX system. Provide a login on the UNIX system, and configure the .rhosts file to enable transparent login without requiring a password. See your UNIX documentation for details on how to do this.
If you have closed NetExpress, open it as before. If any project window or text windows are open, close them.
In this sample session you:
To create a project for your application:
The project window for the project appears, and the project is scanned for dependencies. It currently contains just the COBOL program you are going to use to build your application.
When building this application, we need to set an option so we will be warned if it contains any features not portable to UNIX.
A message warning that the intermediate code is not portable is displayed in the Output window. You may need to make the Output window bigger to see the message. You need to edit the file to change the non-portable syntax:
An edit window opens and the line containing the problem is marked by a red cross in the margin.
This line was flagged by the compiler because the filename contained a space. A filename that contains spaces can be used on Windows, but not on UNIX.
Your program should now compile without warnings, and you can deploy the application to the UNIX system.
NetExpress includes terminal emulation software, PowerTerm, so you can use your PC as a UNIX terminal. While running this tutorial, you may find it convenient to use PowerTerm to give you a separate window open on your PC as a terminal onto your UNIX host system. If you don't intend to do this, either because you have other terminal emulation software or because you are using a separate UNIX terminal, you can skip this section.
Deployment is known as publishing in the UNIX Option. It consists of copying the files to the correct directories on the UNIX system and building the application there. Accessible from the NetExpress menus is a tool, Publisher, that handles this process.
First you provide Publisher with details of the publish operation required:
This displays the form shown in Figure 14-1.
Figure 14-1: The Setup Dialog Box
Figure 14-2: The Server Dialog Box
The list box displays any servers that have currently been defined. If you select one of these, then any changes you make using the buttons in this tab are made to the selected server. The entry New Server enables you to define a new server. If there are no servers currently configured, New Server is selected by default and all of the buttons on the dialog except Settings are deactivated (see figure above).
Figure 14-3: Specifying a Server
Figure 14-4: Server Settings
To publish the application:
This builds the project on the PC, creates a file called Makefile to do the same thing on UNIX, copies the project files to the UNIX system and runs Makefile there.
If you have any problem, check your setup - use Setup on the UNIX menu again - to ensure you specified the server name, UNIX login name, and directory names correctly, and try again.
If this doesn't solve the problem, see the chapter Tips and Troubleshooting in the UNIX Option User Guide
If the log file shows any errors, or if any of the files listed in the next section Files Created are not present in your UNIX build directory, check your setup and try again.
Publish publishes only files that have changed since the previous time you published the project. Publish All publishes all the files unconditionally. If you run this tutorial a second time, do not first delete the files from your build directory on UNIX. Publish will not know they have gone, and will not replace them. Alternatively, if you do delete the files from your UNIX directory, use Publish All.
UNIX Option has now created the following file for you in your project directory on the PC and copied it into your build directory on UNIX (it has not added it to the project, as it is not used on the PC):
It has also copied the following file from your project directory on the PC into your build directory on UNIX:
The build directory also contains the following files created by the build process on UNIX:
Several files created for use during the build process are also in the build directory on UNIX.
Note that filenames on UNIX are case sensitive.
To run the application
cobrun Unixo.int
All that Unixo.cbl does is create this file, so if this file exists the application has been built and run correctly.
Close the project.
If you're using PowerTerm, logoff from UNIX in your usual way and click Exit on PowerTerm's File menu.
If you're planning to go straight on to another session, you can keep NetExpress open.
Return to the Tutorials Map in the chapter Start Here for the Tutorials and choose which session to go on to next, depending on your interests.
Copyright © 1998 Micro Focus Limited. All rights reserved.
This document and the proprietary marks and names
used herein are protected by international law.
Completing and Running Your Windows GUI Application | Windows Tips |