Compile and Link
Job Scripts for COBOL Programs
  Table of Contents  v-2.01.01 - cblbuild.htm 
  Introduction
  Batch Job Input and Output
  Batch Job Requirements
  Batch Job Scripts
  Primary Windows CMD Files
  Prepare and Compile CBL to INT
  Prepare and Compile CBL to GNT
  Prepare, Compile and Link CBL to EXE
  Technical Details
  Secondary Windows CMD Files
  Compile CBL to INT
  Compile CBL to GNT
  Compile and Link CBL to EXE
  Compiler Directives
  Directives for CBL to INT or GNT
  Directives for CBL to EXE
  Ancillary Functionality
  Set the Environment
  Display and Log Messages
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Contact or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This document will describe the process for creating executable members from COBOL source members. The process uses Job Scipts or Batch Job Processing techniques. This process was originally created and executed using Microsoft Windows 2000 Professional with Micro Focus Net Express 3.0 and 3.1.

Explore the SIMOTIME Web Site for additional information about the technologies and services that are available.


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-2024
SimoTime Technologies and Services
All Rights Reserved

Table of Contents Previous Section Next Section Batch Job Input and Output

The following shows the input and output for the job scripts that do the program compilation and linkage.

1. Primary Input
1.1. COBOL Source Code for Application Programs
1.2. COBOL Copy Files
2. Secondary Input
2.1. Specifications for the Micro Focus COBOL Compiler
2.2. Specifications for the Microsoft Linker
3. Primary Output
3.1. An Executable Program
3.1.1. Micro Focus Intermediate or INT Format
3.1.2. Micro Focus Generated or GNT Format
3.1.3. A Windows Executable or EXE Format
4. Secondary Output
4.1. A Micro Focus compiler listing
4.2. A Microsoft linkage editor map

 

Table of Contents Previous Section Next Section Batch Job Requirements

This suite of samples programs will run on the following platforms.

1. Requires Microsoft Windows 2000 Professional or Windows/XP System.
2. Requires Micro Focus Net Express 3.0 or 3.1.
3. Requires the SimoTime Library to be installed.

 

The preceding is a list of the Batch Job Requirements for the Operating System, Sub-systems and Utility Programs.

Table of Contents Previous Section Next Section Batch Job Scripts

This section describes the batch job scripts that are used to create test data files and execute the test cases. A Job Script will identify and allocate resources (data files, memory, work areas, control information, etc.) for the Job or Job Step and execute programs that will process, access or utilize the allocated resources.

Table of Contents Previous Section Next Section Primary Windows CMD Files

The following Job Scripts are Windows CMD Files that may be executed from a CMD Line Window or from Windows Explorer by simply double-clicking on the item name.

The Job Scripts may call other Job Scripts to perform shared or repetitive tasks.

Table of Contents Previous Section Next Section Prepare and Compile CBL to INT

The following Job Script is a Windows CMD File (CBUT2AW1_INT.cmd) used to prepare the environment, allocate the resources and compile the COBOL program.

@echo OFF
     set CmdName=CBLUT2AW1_INT
rem  * *******************************************************************
rem  *                Job Script - a Windows Command File                *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2019 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 COBOLUT2 Folder (or Library).
rem  *
rem  * This procedure calls the following Windows Command Files.
rem  * 1. Env1Base.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
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
     set zDIRS=%BaseLib1%\DIRS\MiFoAscIBMcomp.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=COBOLUT2
     set TLIB1=HOLD\UT2A
     set MemberList=%BASELIB1%\ADM1\CNTL\SIMOTIME.ADM1.COBOLUT2.lst
     dir /on /b /a-d %BaseLib1%\%SLIB1%\UTS*.cbl>%MemberList%
     for /F "eol=; tokens=1,2* delims=." %%i in (%MemberList%) do CALL zCBL2INT %%i %SLIB1% %TLIB1%
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

Table of Contents Previous Section Next Section Prepare and Compile CBL to GNT

The following Job Script is a Windows CMD File (CBUT2AW1_GNT.cmd) used to prepare the environment, allocate the resources and compile the COBOL program.

@echo OFF
     set CmdName=CBLUT2AW1_GNT
rem  * *******************************************************************
rem  *                Job Script - a Windows Command File                *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2019 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 COBOLUT2 Folder (or Library).
rem  *
rem  * This procedure calls the following Windows Command Files.
rem  * 1. Env1Base.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
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
     set zDIRS=%BaseLib1%\DIRS\MiFoAscIBMcomp.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=COBOLUT2
     set TLIB1=HOLD\UT2A
     set MemberList=%BASELIB1%\ADM1\CNTL\SIMOTIME.ADM1.COBOLUT2.lst
     call SimoNOTE "* Member List is %Memberlist%"
     dir /on /b /a-d %BaseLib1%\%SLIB1%\TC*.cbl>%MemberList%
     for /F "eol=; tokens=1,2* delims=." %%i in (%MemberList%) do CALL zCBL2GNT %%i %SLIB1% %TLIB1%
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

Table of Contents Previous Section Next Section Prepare, Compile and Link CBL to EXE

The following Job Script is a Windows CMD File (CBUT2AW1_EXE.cmd) used to prepare the environment, allocate the resources and compile the COBOL program.

@echo OFF
     set CmdName=CBUT2AW1_EXE
rem  * *******************************************************************
rem  *             CBUT2AW1_EXE.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 COBOLUT2 Folder (or Library).
rem  *
rem  * This procedure calls the following Windows Command Files.
rem  * 1. Env1Base.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
     set MIFOSYS1=NET3
     call ..\ENV1BASE
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
     set zDIRS=%BaseLib1%\DIRS\ORANGE_EXE_CRT.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=COBOLUT2
     set TLIB1=HOLD\EXEA
     set MemberList=%BASELIB1%\ADM1\CNTL\SIMOTIME.ADM1.COBOLUT2.EXE.lst
REM  *     dir /on /b /a-d %BaseLib1%\%SLIB1%\*.CBL>%MemberList%
     for /F "eol=; tokens=1,2* delims=." %%i in (%MemberList%) do CALL zCBL2EXE %%i %SLIB1% %TLIB1%
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

Table of Contents Previous Section Next Section Technical Details

This section provides additional technical details about the modules that are included in the batch job example.

Table of Contents Previous Section Next Section Secondary Windows CMD Files

The following Job Scripts are Windows CMD Files that may be called from other Job Scripts and may be dependent on parameters and environment variables created by the calling Job Script.

Table of Contents Previous Section Next Section Compile CBL to INT

The following Job Script is a Windows CMD File (ZCBL2INT.cmd) that is called to do the actual compile of the COBOL Source member and create an executable INT Member.

     set TASKNAME=ZCBL2INT
rem  * *******************************************************************
rem  *                Job Script - a Windows Command File                *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2019 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  * It is the callers reponsibility to set the following environment
rem  * variable prior to calling the command.
rem  * 1. BaseLib1 - point to the base directory. This procedure uses
rem  *               various sub-directories under the base directory.
rem  * 2. DirsLib1 - point to the directory that contains the DIR files.
rem  * 3. zDIRS    - point to the fully qualified name of the default
rem  *               directives file.
rem  *
rem  * The following parameters are received from the calling command.
rem  * Parameter  Description
rem  * ---------  --------------------------------------------------------
rem  *    1.      Name of source member
rem  *    2.      Name of source directory relative to BaseLib1
rem  *    3.      Name of directory for load member relative to BaseLib1
rem  * ---------  --------------------------------------------------------
rem  *            Expected parameters are as follows.
rem  *            Parm-1 - Member name without extension
rem  *            Parm-2 - Name of source directory relative to BaseLib1
rem  *            Parm-3 - Name of output directory relative to BaseLib1
rem  * *******************************************************************
rem  * The following two statements will first set the compile options to
rem  * use the directives file specified in the zDIRS environment variable.
rem  * The second statement will then check for a .DIR file with the same
rem  * name as the program.
rem  * If this exists then it will override zDIRS value.
rem  *
     set Compile2GNTStatus=0000
     set CompileOptions=%zDIRS%
     if exist %DirsLib1%\%~n1.DIR set CompileOptions=%DirsLib1%\%~n1.DIR
     call SimoNOTE "Starting %TASKNAME%, RC=%Compile2GNTStatus%, PGM=%1"
     echo Compile Options = %CompileOptions%
     call SimoNOTE "DIR-File %CompileOptions%"
rem  *
rem  * *******************************************************************
rem  * Do the compile to create the .INT executable using Micro Focus compiler.
     cobol %BaseLib1%\%2\%1.cbl,%BaseLib1%\%3\%1.int USE(%CompileOptions%) LISTPATH(%BaseLib1%\LIST);
     if not "%ERRORLEVEL%" == "0" set Compile2GNTStatus=0010
     if not "%Compile2GNTStatus%" == "0000" goto :Compile2GNTNOK
rem  *
     if exist %BaseLib1%\%3\%1.INT goto :Compile2GNTAOK
     set Compile2GNTStatus=0020
     goto :Compile2GNTNOK
rem  *
rem  * *******************************************************************
:Compile2GNTAOK
     if "%TransferGnt%"=="Y"  (echo Transfer GNT is ENABLED
                               COPY /Y %BaseLib1%\%3\%1.GNT %BaseLib1%\LOADLIB\%1.GNT)
     if "%EraseAfter%"=="Y"   (echo Erase After is ENABLED
                               ERASE %BaseLib1%\%3\%1.GNT)
     set /A AOK_Count=%AOK_Count% + 1
     call SimoNOTE "Complete %TASKNAME%, RC=%Compile2GNTStatus%, PGM=%1"
     goto :End
rem  *
rem  * *******************************************************************
:Compile2GNTNOK
     set JobStatus=%Compile2GNTStatus%
     set /A NOK_Count=%NOK_Count% + 1
     call SimoNOTE "ABENDING %TASKNAME%, RC=%Compile2GNTStatus%, PGM=%1, !!!ABENDING!!!"
     echo %1 - Error during Compile, refer to %BaseLib1%\LIST\%1.LST>%BaseLib1%\LOGS\%1.ERR
     goto :End
rem  *
rem  * *******************************************************************
:End

Table of Contents Previous Section Next Section Compile CBL to GNT

The following Job Script is a Windows CMD File (ZCBL2GNT.cmd) that is called to do the actual compile of the COBOL Source member and create an executable GNT Member.

rem  * *******************************************************************
rem  *               ZCBL2GNT.CMD - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2015 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  * It is the callers reponsibility to set the following environment
rem  * variable prior to calling the command.
rem  * 1. BaseLib1 - point to the base directory. This procedure uses
rem  *               various sub-directories under the base directory.
rem  * 2. DirsLib1 - point to the directory that contains the DIR files.
rem  * 3. zDIRS    - point to the fully qualified name of the default
rem  *               directives file.
rem  *
rem  * The following parameters are received from the calling command.
rem  * Parameter  Description
rem  * ---------  --------------------------------------------------------
rem  *    1.      Name of source member
rem  *    2.      Name of source directory relative to BaseLib1
rem  *    3.      Name of directory for load member relative to BaseLib1
rem  * ---------  --------------------------------------------------------
rem  *            Expected parameters are as follows.
rem  *            Parm-1 - Member name without extension
rem  *            Parm-2 - Name of source directory relative to BaseLib1
rem  *            Parm-3 - Name of output directory relative to BaseLib1
rem  * *******************************************************************
rem  * The following two statements will first set the compile options to
rem  * use the directives file specified in the zDIRS environment variable.
rem  * The second statement will then check for a .DIR file with the same
rem  * name as the program.
rem  * If this exists then it will override zDIRS value.
rem  *
     set Compile2GNTStatus=0000
     set CompileOptions=%zDIRS%
     if exist %DirsLib1%\%~n1.DIR set CompileOptions=%DirsLib1%\%~n1.DIR
     call SimoNOTE "+ Starting ZCBL2GNT, RC=%Compile2GNTStatus%, PGM=%1"
     echo Compile Options = %CompileOptions%
     call SimoNOTE "+ DIR-File %CompileOptions%"
rem  *
rem  * *******************************************************************
rem  * Do the compile to create the .GNT executable using Micro Focus compiler.
     cobol %BaseLib1%\%2\%1 OMF(GNT),%BaseLib1%\%3\ USE(%CompileOptions%) LISTPATH(%BaseLib1%\LIST);
     if not "%ERRORLEVEL%" == "0" set Compile2GNTStatus=0010
     if not "%Compile2GNTStatus%" == "0000" goto :Compile2GNTNOK
rem  *
     echo %BaseLib1%\%3\%1.GNT
     if "%SimoMSG%" == "1" call SimoNOTE "CBL-Copy %cobcpy%"
     if exist %BaseLib1%\%3\%1.GNT goto :Compile2GNTAOK
     set Compile2GNTStatus=0020
     goto :Compile2GNTNOK
rem  *
rem  * *******************************************************************
:Compile2GNTAOK
     if "%TransferGnt%"=="Y"  (echo Transfer GNT is ENABLED
                               COPY /Y %BaseLib1%\%3\%1.GNT %BaseLib1%\LOADLIB\%1.GNT)
     if "%EraseAfter%"=="Y"   (echo Erase After is ENABLED
                               ERASE %BaseLib1%\%3\%1.GNT)
     set /A AOK_Count=%AOK_Count% + 1
     call SimoNOTE "+ Complete ZCBL2GNT, RC=%Compile2GNTStatus%, PGM=%1"
     goto :End
rem  *
rem  * *******************************************************************
:Compile2GNTNOK
     set JobStatus=%Compile2GNTStatus%
     set /A NOK_Count=%NOK_Count% + 1
     call SimoNOTE "+ ABENDING ZCBL2GNT, RC=%Compile2GNTStatus%, PGM=%1, !!!ABENDING!!!"
     echo %1 - Error during Compile, refer to %BaseLib1%\LIST\%1.LST>%BaseLib1%\LOGS\%1.ERR
     goto :End
rem  *
rem  * *******************************************************************
:End

Table of Contents Previous Section Next Section Compile and Link CBL to EXE

The following Job Script is a Windows CMD File (ZCBL2EXE.cmd) that is called to do the actual compile of the COBOL Source member and create an executable EXE Member.

     set CMDNAME=CBL2EXE
rem  * *******************************************************************
rem  *                Job Script - a Windows Command File                *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2019 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  * It is the callers reponsibility to set the following environment
rem  * variable prior to calling the command.
rem  * 1. BaseLib1 - point to the base directory. This procedure uses
rem  *               various sub-directories under the base directory.
rem  * 2. DirsLib1 - point to the directory that contains the DIR files.
rem  * 3. zDIRS    - point to the fully qualified name of the default
rem  *               directives file.
rem  *
rem  * The following parameters are received from the calling command.
rem  * Parameter  Description
rem  * ---------  --------------------------------------------------------
rem  *    1.      Name of source member
rem  *    2.      Name of source directory relative to BaseLib1
rem  *    3.      Name of directory for load member relative to BaseLib1
rem  * ---------  --------------------------------------------------------
rem  *            Expected parameters are as follows.
rem  *            Parm-1 - Member name without extension
rem  *            Parm-2 - Name of source directory relative to BaseLib1
rem  *            Parm-3 - Name of output directory relative to BaseLib1
rem  * *******************************************************************
rem  * The following two statements will first set the compile options to
rem  * use the directives file specified in the zDIRS environment variable.
rem  * The second statement will then check for a .DIR file with the same
rem  * name as the program.
rem  * If this exists then it will override zDIRS value.
rem  *
     set Compile2GNTStatus=0000
     set CompileOptions=%zDIRS%
     if exist %DirsLib1%\%~n1.DIR set CompileOptions=%DirsLib1%\%~n1.DIR
     call SimoNOTE "Starting %CMDNAME%, RC=%Compile2GNTStatus%, PGM=%1"
     echo Compile Options = %CompileOptions%
     call SimoNOTE "DIR-File %CompileOptions%"
     call SimoNOTE "CBL_TAKE %BaseLib1%\%2\%1.cbl"
rem  *
rem  * *******************************************************************
rem  * Create the .EXE executable using the Micro Focus CBLLINK Program.
rem  * CBLLINK will execute three following three programs.
rem  * 1. The Micro Focus COBOL Compiler.
rem  * 2. CBLNAMES is provided by Micro Focus.
rem  * 3. The Microsoft Linker.
rem  *
rem  * Switches  Description
rem  * -BMF      Causes a Static runtime, Multi thread and Full function
rem  *           executable member to be created.
rem  * -l        Causes the Link program to produce a Link Map File.
rem  * -v        Causes a detailed display to the screen of the command
rem  *           lines that execute the programs run by Cbllink, and the
rem  *           results for each program.
rem  * -u        Precedes the name of a user defined COBOL source member.
rem  *
     CBLLINK -BMF -l -v -u%CompileOptions% %BaseLib1%\%2\%1.cbl
rem  *
     if not "%ERRORLEVEL%" == "0" set Compile2GNTStatus=0010
     if not "%Compile2GNTStatus%" == "0000" goto :Compile2GNTNOK
rem  *
     echo %BaseLib1%\ADM1\%1.exe
     if "%SimoMSG%" == "1" call SimoNOTE "CBL-Copy %cobcpy%"
     if exist %BaseLib1%\ADM1\%1.exe goto :Compile2GNTAOK
     set Compile2GNTStatus=0020
     goto :Compile2GNTNOK
rem  *
rem  * *******************************************************************
:Compile2GNTAOK
     if "%TransferGnt%"=="Y"  (echo Transfer GNT is ENABLED
                               COPY /Y %BaseLib1%\%3\%1.GNT %BaseLib1%\LOADLIB\%1.GNT)
     if "%EraseAfter%"=="Y"   (echo Erase After is ENABLED
                               ERASE %BaseLib1%\%3\%1.GNT)
     set /A AOK_Count=%AOK_Count% + 1
     call SimoNOTE "Complete %CMDNAME%, RC=%Compile2GNTStatus%, PGM=%1"
     goto :End
rem  *
rem  * *******************************************************************
:Compile2GNTNOK
     set JobStatus=%Compile2GNTStatus%
     set /A NOK_Count=%NOK_Count% + 1
     call SimoNOTE "ABENDING %CMDNAME%, RC=%Compile2GNTStatus%, PGM=%1, !!!ABENDING!!!"
     echo %1 - Error during Compile, refer to %BaseLib1%\LIST\%1.LST>%BaseLib1%\LOGS\%1.ERR
     goto :End
rem  *
rem  * *******************************************************************
:End

Table of Contents Previous Section Next Section Compiler Directives

The following Job Scripts are Windows CMD Files that may be called from other Job Scripts and may be dependent on parameters and environment variables created by the calling Job Script.

Table of Contents Previous Section Next Section Directives for CBL to INT or GNT

The following COBOL Directives File (MIFOASCIBMCOMP.dir) defines the directives used when compiling to create an INT executable member.

DIALECT"MF"
CHARSET"ASCII"
ASSIGN"EXTERNAL"
IDXFORMAT"8"
IBMCOMP
NOTRUNC
RTNCODE-SIZE"2"
NOOPTIONAL-FILE
NOHOSTFD
NOQUERY
COBIDY
NOANIM
outdd"SYSOUT 121 L"
SHARE-OUTDD
DATAMAP
settings
list()
noform

Table of Contents Previous Section Next Section Directives for CBL to EXE

The following COBOL Directives File (MIFOASCIBMCOMP_NOHAREOUTDD.dir) defines the directives used when compiling and linking to create an EXE executable member.

DIALECT"MF"
CHARSET"ASCII"
ASSIGN"EXTERNAL"
IDXFORMAT"8"
IBMCOMP
NOTRUNC
RTNCODE-SIZE"2"
NOOPTIONAL-FILE
NOHOSTFD
NOQUERY
COBIDY
NOANIM
DATAMAP
settings
list()
noform

Table of Contents Previous Section Next Section Ancillary Functionality

This section provides additional detail about the CMD files and programs that are used to support this set of sample programs.

Table of Contents Previous Section Next Section Set the Environment

A Windows command file (ENV1BASE.cmd) is called from other command files to set commonly used environment variables. This provides a single point of definition. The following is a listing of the contents of the command file.

@echo OFF
rem  * *******************************************************************
rem  *               ENV1BASE.cmd - a Windows Command File               *
rem  *        This program is provided by SimoTime Technologies          *
rem  *           (C) Copyright 1987-2021 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Provide a single point to set common environment variables.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * Set the commonly used environment variables. This is used to provide
rem  * a single point for managing the commonly used environment variables.
rem  *
     set SimoLIBR=c:\SimoLIBR
     set BASELIB1=c:\SIMOSAM1\DEVL
     set BASELIB8=c:\SimoSAM8
     set BaseWIP1=c:\SimoSAM1\WIP1
     set DATAZERO=c:\SIMODATA\DEVL\DATA\ZERO
     set BASEAPP=%BaseLib1%
     set BASESYS=%BaseLib1%\SYS1
     set BASECAT=%BaseLib1%\DATA
     set UMAPALIB=%BASECAT%\ASC1
     set UMAPELIB=%BASECAT%\EBC1
     set SYSLOG=%BASESYS%\LOGS\SYSLOG_USER.DAT
     set SYSOUT=%BASEAPP%\LOGS\SYSOUT_SIMSAM01.txt
     set SLZMSG=%BASEAPP%\LOGS\SLZMSG_USER.TXT
     set PostNOTE=%BASEAPP%\LOGS\JOBLOG_SIMONOTE.TXT
     set SIMONOTE=%BASEAPP%\LOGS\JOBLOG_SIMONOTE.txt
     set USERPOST=%BASEAPP%\LOGS\ASSIGNED_USER_POST_FILE.txt
     if [%1]==[] goto NO_POST
     set SYSOUT=%BaseLib1%\LOGS\SYSOUT_%1.txt
     call SIMONOTE "+ ENV1BASE *"
     call SIMONOTE "+ ENV1BASE ********************************************************************%1"
     call SIMONOTE "+ ENV1BASE is preparing the System Environment..."
     call SIMONOTE "+ SIMOLIBR is %SIMOLIBR%"
     call SIMONOTE "+ MIFOSYS1 is %MIFOSYS1%"
     call SIMONOTE "+ BASELIB1 is %BASELIB1%"
:NO_POST
     call SIMONOTE "+ SIMONOTE Job Log File is %SIMONOTE% "
rem  *
     set MQBASE=C:\Program Files\IBM\WebSphere MQ
rem  *
rem  * Set the location for the Apache-Tomcat Server...
     set CATALINA_HOME=C:\APACHETC\apache-tomcat-7.0.52
rem     set CATALINA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_112
rem  *
rem  * Set the Environment for the Java Environment...
rem     set JAVABASE=C:\APACHETC\apache-tomcat-7.0.52
     set JAVABASE=C:\Program Files (x86)\Java\jdk1.8.0_112
     set JAVASDK="%JAVABASE%\bin"
     set JAVA_HOME=%JAVABASE%
     set JRE_HOME=%JAVABASE%
     set SIMOTCAT=%CATALINA_HOME%\webapps\simotcat
     set SIMPACKS=%CATALINA_HOME%\webapps\simotcat\WEB-INF\classes\simpacks
rem  *
rem  * Set the environment for the Micro Focus technology...
     set MIFOEDEV=C:\Program Files (x86)\Micro Focus\Enterprise Developer
     set MIFOVCBL=C:\Program Files (x86)\Micro Focus\Visual COBOL Build Tools
     set MIFOESTU=C:\Program Files (x86)\Micro Focus\Studio Enterprise Edition 6.0
     set MIFOEMFE="C:\Program Files (x86)\Micro Focus\Mainframe Express"
rem  *
rem  * Large file support, performance tuning and record locking of the File Handler
     set EXTFH=%BASESYS%\CONFIG\EXTFHBIG.CFG
rem  *
rem  * For IMS Support
     set ES_IMSLIB=%BASEAPP%\IMSLIB
     set ES_ACBLIB=%BASEAPP%\IMSLIB
rem  *
rem  * EZASOKETS Check EZASOKETS Enabled box or set ES_EZASOKET_SUPPORT=YES
     set EZACONFG=BASESYS1\CONFIG\EZACONFG.dat
rem  *
rem  * Resource Allocation and Performance for SORT and non-Relational Data
rem  set MFJSENGINE=SYNCSORT
     set SORTSCHEME=1
     set SORTSPACE=750000000
     set TMP=C:\SORTWORK
rem  *
     set ES_ALLOC_OVERRIDE=%BASESYS%\CONFIG\CATMAPA1.cfg
rem  * For CORE_ON_ERROR function, ABEND Dump
rem  *     set COBCONFIG_=%BASESYS%\CONFIG\diagnose.cfg
rem  *
rem  * Consolidated Trace Facility (CTF)
rem  *     set MFTRACE_CONFIG=%BASESYS%\CONFIG\ctf.cfg
rem  *     set MFTRACE_LOGS=c:\ctflogs
rem  *
rem  * For Job Restart, ABEND Recovery
     set MF_UCC11=Y
     set ES_JES_RESTART=Y
rem  *
rem  * Set environment for MFBSI (Micro Focus Batch Scheduling Interface)
     set ES_EMP_EXIT_1=mfbsiemx
     set MFBSI_DIR=%BASESYS%\LOGS\%JESSERVERNAME%
     set MFBSIEOP_CMD=ENABLE
     set MFBSIEOP_CSV=ENABLE
     set MFBSIEOP_HTM=ENABLE
     set MFBSIEOP_XML=ENABLE
rem  *
rem  * Set Behavior and Trace Flags for GETJOBDD
rem  *   Position=12345678/12345678
     set JDDFLAGS=nnnWnnnn/YYnnnnnn
rem  *
rem  * If not already set then set the PATH for Micro Focus Directories
     if "%SIMOPATH%" == "Y" goto JUMPPATH
     if "%MIFOSYS1%" == "EDEV" goto JUMPEDEV
     if "%MIFOSYS1%" == "VCBL" goto JUMPVCBL
     if "%MIFOSYS1%" == "ESTU" goto JUMPESTU
     if "%MIFOSYS1%" == "EMFE" goto JUMPEMFE
:JUMPEDEV
     set path=%BASESYS%\LOADLIB;%MIFOEDEV%\bin;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%;%MIFOEDEV%\CPYLIB
     set MIFOBASE=%MIFOEDEV%
     goto JUMPPATH
:JUMPVCBL
     set path=%MIFOVCBL%\bin;%MIFOVCBL%;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set MIFOBASE=%MIFOVCBL%
     goto JUMPPATH
:JUMPESTU
     set MIFOBASE=%MIFOESTU%\Base
     set MIFOBIN=%MIFOBASE%\bin
     set path=%BASESYS%\LOADLIB;%MIFOBASE%;%MIFOBIN%;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%;%MIFOBASE%\SOURCE
     goto JUMPPATH
:JUMPEMFE
     set MIFOBASE=%MIFOEMFE%\Base
     set MIFOBIN=%MIFOBASE%\bin
     set path=%BASESYS%\LOADLIB;%MIFOBASE%;%MIFOBIN%;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%;%MIFOBASE%\SOURCE
     goto JUMPPATH
rem  *
:JUMPPATH
     set SIMOPATH=Y
rem  *
     set MAINFRAME_FLOATING_POINT=true
     set COBIDY=%BASEAPP%\COBIDY
     set COBPATH=.;%BASEAPP%\LOADLIB;%BASEAPP%\LOADLIB\GNTS;%BASESYS%\LOADLIB;%SimoLIBR%
     set LIBPATH=.;%BASEAPP%\LOADLIB;%BASEAPP%\LOADLIB\GNTS;%BASESYS%\LOADLIB;%SimoLIBR%
     set TXDIR=%BASESYS%\LOADLIB;%MIFOBASE%
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%
rem  *
     set USERCLASS=%BASELIB1%\LOADLIB
     set CLASSPATH=.
     set CLASSPATH=%CLASSPATH%;%JAVABASE%
     set CLASSPATH=%CLASSPATH%;%JAVABASE%\lib
     set CLASSPATH=%CLASSPATH%;\%USERCLASS%\simpacks
     set CLASSPATH=%CLASSPATH%;C:\APACHETC\apache-tomcat-7.0.52\webapps\simotcat\WEB-INF\classes
     set CLASSPATH=%CLASSPATH%;C:\APACHETC\apache-tomcat-7.0.52\webapps\simotcat\WEB-INF\classes\simpacks
rem  *
     if "%MIFOSYS1%" == "ESTU" set CLASSPATH=%CLASSPATH%;%MIFOBIN%
     if "%MIFOSYS1%" == "EDEV" set CLASSPATH=%CLASSPATH%;%MIFOEDEV%
     if "%MIFOSYS1%" == "VCBL" set CLASSPATH=%CLASSPATH%;%MIFOVCBL%
     if "%MIFOSYS1%" == "VCBL" set CLASSPATH=%CLASSPATH%;%MIFOVCBL%\bin\mfcobol.jar
rem  *
     set JobStatus=0000
     call SIMONOTE "+ ENV1BASE is returning to caller"


Table of Contents Previous Section Next Section Display and Log Messages

The following (SIMONOTE.cmd) is a listing of the contents of the SimoNOTE.CMD command file.

@echo OFF
rem  * *******************************************************************
rem  *               SIMONOTE.cmd - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *            (C) Copyright 1987-2019 All Rights Reserved            *
rem  *              Web Site URL:   http://www.simotime.com              *
rem  *                    e-mail:   helpdesk@simotime.com                *
rem  * *******************************************************************
rem  *
rem  * Text    - Display message on screen and write to a log file.
rem  * Author  - SimoTime Technologies
rem  *
rem  * This script may be called from other scripts and expects a single
rem  * parameter enclosed in double quotes. The double quotes will be
rem  * removed. Before writing to the log file a date and time stamp
rem  * will be inserted in front of the message text.
rem  *
rem  * Note: The tilde (~) removes leading/trailing double-quotes.
rem  *
if "%SimoNOTE%" == "" set SimoNOTE=c:\SimoLIBR\LOGS\SimoTime.LOG
echo %date% %time% %~1>> %SimoNOTE%
echo %~1

Table of Contents Previous Section Next Section Summary

This document describes the process for creating executable members from COBOL source members. The process uses Job Scipts or Batch Job Processing techniques. This process was originally created and executed on a Microsoft Windows NT2000 System with Micro Focus Net Express 3.0. This document may be used to assist as a tutorial for new assembler programmers or as a quick reference for experienced programmers. The samples focus on the coding techniques of the individual instructions. As always, it is the programmer's responsibility to thoroughly test all programs.

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 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.

Link to Internet   Link to Server   Explore a Scripted Application Build Process for an application that has been moved from a Mainframe System to a Windows system running a Micro Focus sub-system such as Enterprise Server, Application Server or Net Express.

Link to Internet   Link to Server   Explore the Compiler Directives available for the Micro Focus COBOL technologies.

Link to Internet   Link to Server   Explore the COBOL Connection for more examples of COBOL programming techniques and sample code.

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 that are used 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 (including Micro Focus COBOL) 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 Contact 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 and Link from CMD Line
Copyright © 1987-2024
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com