Compile COBOL Source
CMD File to Create a Load Member
  Table of Contents  v-14.03.28 - nxbldl22.htm 
  Introduction
  Compile, Command Line Interface
  View and Understand the Script File
  Compile the Programs
  Review the Compile Results
  Promote Load Members to LOADLIB
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Comments or Feedback
  Company Overview

Table of Contents Previous Section Next Section Introduction

This document describes how to compile a COBOL source member from a Windows command line using Micro Focus Enterprise Developer to create an executable load member. The objectives for this session are as follows.

1. Create or use a Windows command file to compile a program.
2. Create or use a COBOL.DIR file to set compiler directives.
3. Provide an audit or validation trail of success or failure using a log file.
4. Promote the load members to a load library for unit testing.

Note: This module is part of The SimoPATH Series of training and reference materials. For more information refer to The Internet Home Page for The SimoPATH Series.


We have made a significant effort to ensure the documents and software technologies are correct and accurate. We reserve the right to make changes without notice at any time. The function delivered in this version is based upon the enhancement requests from a specific group of users. The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources.

Copyright © 1987-2019
SimoTime Technologies and Services
All Rights Reserved

Table of Contents Previous Section Next Section Compile, Command Line Interface

This section describes how to use a Windows Command Line Interface (CLI using a CMD or BAT file) to compile COBOL source members and create executable DLL's to be used in a test or production environment. This process automates the build process for creating the executable programs from COBOL source code and provides an output file that documents the process and identifies a success or failure for each compile step.

Table of Contents Previous Section Next Section View and Understand the Script File

This self-study exercise will use a previously created command file to compile the program or programs that will be used for the data file compare process.

Windows Explorer may be used to view the CBUT1AE1.cmd file. From the left window pane navigate to the "ADM1" folder.

Computer
Local Disk (C:)
 DATAMIG1
 DEVL
 ADM1

From the right window pane select the "CBUT1AE1.cmd" file to open with NotePAD.

The script file (CBUT1AE1.cmd) used in this session is a Microsoft Windows Command File. This command file is located in the "c:\DataMig1\DEVL\ADM1" directory and may be viewed or edited using Notepad.

@echo OFF
rem  * *******************************************************************
rem  *               CBUT1AE1.cmd - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2016 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  * This procedure will create a file containing a list of all the
rem  * COBOL (i.e. filename.cbl) programs. This list will then be used to
rem  * compile all the programs in the COBOLUT1 Folder (or Library).
rem  *
rem  * This procedure calls the following Windows Command Files.
rem  * 1. EMN1BASE.cmd - provides a single point for setting commonly
rem  *                   used environment variables.
rem  * 2. SIMONOTE.cmd - provides a consistent process for displaying
rem  *                   messages to the screen and writing to a journal
rem  *                   or log file.
rem  * 3. ZCBL2GNT.cmd - this will do the actual compile of the specified
rem  *                   program.
rem  *
rem  * Note: To specify the directory to be used for the IDY files use
rem  *       the COBIDY Compiler Directive and set the COBIDY environment
rem  *       variable.
rem  * *******************************************************************
     setlocal
     call ..\ENV1BASE
     set CmdName=CBUT1AE1
rem  *
     call SimoNOTE "***********************************************%CmdName%.cmd"
     call SimoNOTE "Starting JobName %CmdName%.cmd"
rem  *
rem  * Set the environment variable to use the MiFoAsc.DIR directives file
rem  * as the default.
     set DIRSLIB1=%BaseLib1%\DIRS\ASC1
     set zDIRS=%BaseLib1%\DIRS\ASC1\ENTCOBOLAscCBLBAT.DIR
rem  * The following two statements will set the environment variables to
rem  * a "Y" for Yes or "N" for No. A "Y" will cause the function to be
rem  * performed by the called procedure. An "N" value will not perform the
rem  * function.
     set EraseAfter=N
     set TransferGNT=N
rem  *
rem  * Read the file containing a list of program names and pass the contents
rem  * of each record to the command file that does the actual compile.
rem  * Each record in the file contains an eight character program name.
     set AOK_Count=0
     set NOK_Count=0
     set SLIB1=COBOLUT1
     set TLIB1=HOLD\UT1A
     set MemberList=%BASELIB1%\ADM1\CNTL\SIMOTIME.ADM1.COBOLUT1.lst
     dir /on /b /a-d %BaseLib1%\%SLIB1%\*.cbl>%MemberList%
     for /F "eol=; tokens=1,2* delims=." %%i in (%MemberList%) do CALL zCBL2GNT %%i %SLIB1% %TLIB1%
rem  *
     call SimoNOTE "Conclude MIFOSYS1..... %MIFOSYS1% "
     call SimoNOTE "Conclude COBCPY....... %COBCPY% "
     call SimoNOTE "Conclude COBIDY....... %COBIDY% "
rem  *
     call SimoNOTE "AOKcount Compile Count for AOK is %AOK_Count% "
     call SimoNOTE "NOKcount Compile Count for NOK is %NOK_Count% "
     call SimoNOTE "Finished JobName %CmdName%.cmd"
     if not "%SimoGENS%" == "BATCH" pause
     endlocal

The preceding listing shows the records in the command file. The comments (or REMarks) explain the purpose of each step in the job that compiles the programs and writes the information to a log file.

Table of Contents Previous Section Next Section Compile the Programs

From the left window pane of Windows Explorer navigate to the "C:\DATAMIG1\DEVL\ADM1" folder.

Computer
Local Disk (C:)
 DATAMIG1
 DEVL
 ADM1

From the right window pane double click on the "CBUT1AE1.cmd" file to open and execute the command.

The command file should execute and compile the COBOL source code. The ITREKAC1.gnt and ITREKAR1.gnt load members should be placed in the "c:\DataMig1\DEVL\HOLD\UT1A" directory.

Table of Contents Previous Section Next Section Review the Compile Results

Windows Explorer may be used to view the LOG file and examine the detailed information about the compile. From the left window pane navigate to the "LOGS" folder.

Computer
Local Disk (C:)
 DATAMIG1
 DEVL
 LOGS

From the right window pane select the "SIMONOTE_USER.txt" file to open with NotePAD.

Notepad should display the following information (scroll to the end of the file to view the latest entries).

Thu 05/08/2014 13:31:39.23 ***********************************************CBUT1AE1.CMD
Thu 05/08/2014 13:31:39.23 Starting JobName CBUT1AE1.CMD
Thu 05/08/2014 13:31:39.24 Starting ZCBL2GNT, RC=0000, PGM=ITREKAC1
Thu 05/08/2014 13:31:39.24 DIR-File...... c:\DATAMIG1\DEVL\DIRS\ASC1\OS390AscCBLBAT.DIR
Thu 05/08/2014 13:31:39.24 Source........ c:\DATAMIG1\DEVL\COBOLUT1\ITREKAC1.cbl
Thu 05/08/2014 13:31:39.26 Load Member... c:\DATAMIG1\DEVL\HOLD\UT1A\ITREKAC1.gnt
Thu 05/08/2014 13:31:39.63 Complete ZCBL2GNT, RC=0000, PGM=ITREKAC1
Thu 05/08/2014 13:31:39.65 Starting ZCBL2GNT, RC=0000, PGM=ITREKAR1
Thu 05/08/2014 13:31:39.65 DIR-File...... c:\DATAMIG1\DEVL\DIRS\ASC1\OS390AscCBLBAT.DIR
Thu 05/08/2014 13:31:39.65 Source........ c:\DATAMIG1\DEVL\COBOLUT1\ITREKAR1.cbl
Thu 05/08/2014 13:31:39.66 Load Member... c:\DATAMIG1\DEVL\HOLD\UT1A\ITREKAR1.gnt
Thu 05/08/2014 13:31:40.01 Complete ZCBL2GNT, RC=0000, PGM=ITREKAR1
Thu 05/08/2014 13:31:40.01 AOKcount Compile Count for AOK is 2
Thu 05/08/2014 13:31:40.01 NOKcount Compile Count for NOK is 0
Thu 05/08/2014 13:31:40.01 Finished JobName CBUT1AE1.CMD

In the preceding list notice the high-lighted statements. These statements verify the normal completion of the job step that did the compile and the normal completion of the job.

Table of Contents Previous Section Next Section Promote Load Members to LOADLIB

The preceding compile process places the new load members into a staging (or HOLD) directory. To deploy the new load members it will be necessary to promote (or copy) the members from the HOLD directory into the LOADLIB directory. This can be done from Windows Explorer or from a command line.

C:>copy C:\DATAMIG1\DEVL\HOLD\UT1A\*.gnt C:\DATAMIG1\DEVL\LOADLIB\*.gnt

Table of Contents Previous Section Next Section Summary

The purpose of this document is to show how to use a Windows command file to automate the compiling of COBOL source members.

Also, this document may be used to assist as a tutorial for new programmers or as a quick reference for experienced programmers. In the world of programming there are many ways to solve a problem. This document and the links to other documents are intended to provide a choice of alternatives.

Table of Contents Previous Section Next Section Software Agreement and Disclaimer

Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Technologies. Once the fee is received by SimoTime the latest version of the software, documentation or training material will be delivered and a license will be granted for use within an enterprise, provided the SimoTime copyright notice appear on all copies of the software. The SimoTime name or Logo may not be used in any advertising or publicity pertaining to the use of the software without the written permission of SimoTime Technologies.

SimoTime Technologies makes no warranty or representations about the suitability of the software, documentation or learning material for any purpose. It is provided "AS IS" without any expressed or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Technologies shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software, documentation or training material.

Table of Contents Previous Section Next Section Downloads and Links

This section includes links to documents with additional information that are beyond the scope and purpose of this document. The first group of documents may be available from a local system or via an internet connection, the second group of documents will require an internet connection.

Note:  A SimoTime License is required for the items to be made available on a local system or server.

Table of Contents Previous Section Next Section Current Server or Internet Access

The following links may be to the current server or to the Internet.

Note: The latest versions of the SimoTime Documents and Program Suites are available on the Internet and may be accessed using the Link to Internet icon. If a user has a SimoTime Enterprise License the Documents and Program Suites may be available on a local server and accessed using the Link to Server icon.

Link to Internet   Link to Server   Explore The SIMOPATH Series starting at the home page to view information about training sessions and learning materials available from SimoTime Enterprises.

Link to Internet   Link to Server   Explore An Enterprise System Model that describes and demonstrates how Applications that were running on a Mainframe System and non-relational data that was located on the Mainframe System were copied and deployed in a Microsoft Windows environment with Micro Focus Enterprise Server.

Link to Internet   Link to Server   Explore The ASCII and EBCDIC Translation Tables. These tables are provided for individuals that need to better understand the bit structures and differences of the encoding formats.

Link to Internet   Link to Server   Explore The File Status Return Codes to interpret the results of accessing VSAM data sets and/or QSAM files.

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connect.

A good place to start is The SimoTime Home Page for access to white papers, program examples and product information. This link requires an Internet Connection

Explore The Micro Focus Web Site for more information about products and services available from Micro Focus. This link requires an Internet Connection.

Table of Contents Previous Section Next Section Glossary of Terms

Link to Internet   Link to Server   Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.

Table of Contents Previous Section Next Section Comments or Feedback

This document was created and is maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please use the following contact information.

1. Send an e-mail to our helpdesk.
1.1. helpdesk@simotime.com.
2. Our telephone numbers are as follows.
2.1. 1 415 763-9430 office-helpdesk
2.2. 1 415 827-7045 mobile

We appreciate hearing from you.

Table of Contents Previous Section Next Section Company Overview

SimoTime Technologies was founded in 1987 and is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. Our customers include small businesses using Internet technologies to corporations using very large mainframe systems.

Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems. We specialize in preparing applications and the associated data that are currently residing on a single platform to be distributed across a variety of platforms.

Preparing the application programs will require the transfer of source members that will be compiled and deployed on the target platform. The data will need to be transferred between the systems and may need to be converted and validated at various stages within the process. SimoTime has the technology, services and experience to assist in the application and data management tasks involved with doing business in a multi-system environment.

Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at http://www.simotime.com


Return-to-Top
Compile COBOL Source, Create a DLL using Command Line
Copyright © 1987-2019
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com