|
|||||
|
This document describes how to compile a COBOL source member from a Windows command line using Micro Focus Net Express to create an executable DLL.
| 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. |
Note: This module is part of The SimoPATH Series of training and reference materials. For more information refer to The Home Page for The SimoPATH Series.
This section describes how to use a Windows command file (or batch 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.
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.
| 1. | From the Windows Explorer select the C:\DataMig1\CMDS directory. |
| 2. | Highlight the zCblDLL1.CMD then select the "Edit"
item from the context menu. Note: Do not double-click on this item, this would cause the command file to execute. |
NotePAD should display the records within the command file. This is discussed in more detail in the following section.
The following shows the content of the command file used to compile COBOL source code and create executable DLL's. NotePAD was used to display the following information.
@echo off
rem * *******************************************************************
rem * This program is provided by: *
rem * SimoTime Enterprises, LLC *
rem * (C) Copyright 1987-2006 All Rights Reserved *
rem * Web Site URL: http://www.simotime.com *
rem * e-mail: helpdesk@simotime.com *
rem * *******************************************************************
rem *
rem * Text - Compile COBOL source member and create an executable DLL.
rem * Author - SimoTime Enterprises
rem * Date - January 24, 1996
rem *
rem * Set the commonly used environment variables. This procedure uses a
rem * call to EnvDev01.CMD. This approach provides a single point for
rem * defining environment variables and may be called by other build
rem * procedures.
rem *
setlocal
call EnvDev01.CMD
rem *
call SimoNOTE "*******************************************************zCblDLL1.CMD"
call SimoNOTE "Starting JobName zCblDLL1.CMD"
call SimoNOTE "Abstract Batch process to compile source and create executable members"
rem *
rem * *******************************************************************
rem * Delete a previously created COBOL.DIR file and create a new one.
rem * The new file is created using a simply COPY command. The following
rem * set statement for COBDIR helps ensure the correct COBOL.DIR is used.
rem *
if exist %BaseLib1%\CMDS\COBOL.DIR erase %BaseLib1%\CMDS\COBOL.DIR
copy %BaseLib1%\CMDS\zDirDLL1.DIR %BaseLib1%\CMDS\COBOL.DIR
set COBDIR=%BaseLib1%\CMDS;
rem *
rem * *******************************************************************
rem * Call the inline procedure to compile the COBOL programs and return.
rem * This example has only one call to :Compile2DLL. To compile more
rem * programs simply add another call statement.
rem *
call SimoNOTE "Starting JobStep Compile a generated COBOL source member that compares two data files."
CALL :Compile2DLL %BaseLib1%\DLLS\ItUtl3C1.DLL %BaseLib1%\COBOL\ItUtl3C1.CBL
rem *
call SimoNOTE "Produced LogFile %SYSLOG%"
if "%JobStatus%" == "0000" goto :EOJAOK
goto :EOJNOK
rem *
rem * *******************************************************************
rem * Compile to a DLL using the COBOL.DIR file created in the mainline
rem * section of this procedure.
rem * The CBLLINK statement will do the actual compile and link.
rem * The :EOF causes a return to caller within this CMD file.
rem *
:Compile2DLL
set Compile2DLLStatus=0000
if exist %1 erase %1
CBLLINK -D -O%1 %2
if ERRORLEVEL = 1 set Compile2DLLStatus=0010
if not "%Compile2DLLStatus%" == "0000" goto :Compile2DLLNOK
rem *
if exist %1 goto :Compile2DLLAOK
set Compile2DLLStatus=0020
goto :Compile2DLLNOK
:Compile2DLLNOK
set JobStatus=%Compile2DLLStatus%
call SimoNOTE "ABENDING JobStep Compile Step, Status is %Compile2DLLStatus%, Program is %1"
goto :EOF
:Compile2DLLAOK
call SimoNOTE "Complete JobStep Compile Step, Status is %Compile2DLLStatus%, Program is %1"
goto :EOF
rem *
rem * *******************************************************************
:EOJAOK
call SimoNOTE "Finished JobName zCblDLL1.CMD
goto :END
rem * *******************************************************************
:EOJNOK
call SimoNOTE "ABENDING JobName zCblDLL1.CMD"
call SimoNOTE "The SYSLOG file is displayed in a separate Window using NotePAD."
start NotePad %SYSLOG%
pause
rem * *******************************************************************
:END
EndLocal
rem * pause
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.
To execute (or run) the command file script simple double click on the item from the following Windows Explorer screen.
| 1. | Select the "c:\DataMig1\CMDS" directory. |
| 2. | Double click on the "zCblDLL1.CMD" item. |
The command file should execute and compile the COBOL source code. The ITUTL3C1.DLL should be placed in the c:\DataMig1\DLLS directory.
To view the SYSLOG file to verify the execution of the compile job do the following.
| 1. | Select the "c:\DataMig1\LOGS" directory. |
| 2. | Double click on the "SysLog01.TXT" item. |
NotePAD should display the following information (scroll to the end of the file to view the latest entries).
Thu 02/23/2006 19:47:03.14 Starting JobName EnvDev01.CMD Thu 02/23/2006 19:47:03.15 Finished JobName EnvDev01.CMD *** 2006/02/23 19:47:03:21 *******************************************************zCblDLL1.CMD *** 2006/02/23 19:47:03:28 Starting JobName zCblDLL1.CMD *** 2006/02/23 19:47:03:34 Abstract Batch process to compile source and create executable members *** 2006/02/23 19:47:03:40 Starting JobStep Compile a generated COBOL source member that compares two data files. *** 2006/02/23 19:47:03:59 Complete JobStep Compile Step, Status is 0000, Program is c:\DataMig1\COBOL\ItUtl3C1.CBL *** 2006/02/23 19:47:03:64 Produced LogFile c:\DataMig1\LOGS\SysLog01.TXT *** 2006/02/23 19:47:03:67 Finished JobName zCblDLL1.CMD
In the preceding list notice the 7th and 9th records that are high-lighted. These statements verify the normal completion of the job step that did the compile and the normal completion of the job.
The purpose of this document is to show how to use a Windows command file to automate the compiling of COBOL source members.
Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Enterprises. 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 Enterprises.
SimoTime Enterprises 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 express or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Enterprises 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.
The Home Page for The SimoPATH Series is the starting point to view information about training sessions and learning materials available from SimoTime Enterprises.
The SimoZAPS Utility Program has the capability of generating a COBOL program that will do the conversion of sequential and VSAM (KSDS) files between EBCDIC and ASCII. SimoZAPS can also read a sequential file in EBCDIC format and create an ASCII/CRLF file or VSAM KSDS file in ASCII format. The conversion tables may be viewed or modified to meet unique requirements. The Hexcess/2 function provides the capability of viewing, finding or patching the contents of a file in hexadecimal.
The SimoREC1 Utility Program has the capability of generating a callable COBOL program that will do the conversion of a data string between EBCDIC and ASCII. The generated COBOL source code or the conversion tables may be viewed or modified to meet unique requirements. The generated program may be called by an I/O program generated by SimoZAPS.
This item will provide a link to an ASCII or EBCDIC translation table. A column for decimal, hexadecimal and binary is also included.
This document provides a quick summary of the File Status Key for VSAM data sets and QSAM files.
To review all the information available on this site start at The SimoTime Home Page .
Check out The SimoTime Glossary for a list of terms and definitions used in the documents provided by SimoTime.
If you have any questions, suggestions or comments please call or send an e-mail to: helpdesk@simotime.com
We appreciate your comments and feedback.
Founded in 1987, SimoTime Enterprises is a privately owned, Limited Liability Corporation located in Novato, California. 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. This includes the smallest thin client using the Internet and the very large mainframe systems. There is more to making the Internet work for your company's business than just having a nice looking WEB site. It is about combining the latest technologies and existing technologies with practical business experience. It's about the business of doing business and looking good in the process. 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. 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 |
| Copyright © 1987-2007 SimoTime Enterprises, LLC All Rights Reserved |
| When technology complements business |
| http://www.simotime.com |