![]() |
Scripted Application Build The Micro Focus Environment |
| When technology complements business | Copyright © 1987-2012 SimoTime Enterprises All Rights Reserved |
| The SimoTime Home Page |
This document is an introduction or overview of the 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.
A scripted build process may be a requirement in larger environments. A predefined and documented process for doing the build of a production system without operator intervention is a minimum requirement for the audit or validation process.
A scripted application build should be a repeatable process with an audit or validation trail. The process should be executable as an automated, unattended process. Requiring operator input during the application build process introduces an exposure point for error.
The sample process described in this document will display information to the console and write information to a log file based on the results of the execution of the compile and/or generate processes. The sample process will focus on building a production system for the ASCII-encoded environment.
This document addresses the requirement of doing a scripted build of the executable members from source members. It does not address the requirement of converting mainframe, EBCDIC-encoded data to non-mainframe, ASCII-encoded data. Information about data conversion is available in separate documents.
This section provides a minimal amount of information to get started with the scripted application build process.
The following table shows a summary of the four (4) possible steps (or command files) involved in doing a build of a batch and online system.
| ||||||||||
| Doing the Compiles for the Batch and Online Programs |
The preceding command files are discussed in more detail in the following sections of this document.
The "CBBATAE1.CMD" command file will be used to compile the COBOL programs used by the batch applications. The command may be executed from Windows Explorer, called by another command file or from within a Windows Command prompt screen. The following shows the command line syntax.
C:\SimoSam1\Adm1> CBBATAE1
This job will first call Env1Base to set the environment variables used by the various application build functions. Next, the Windows "FOR" command is used to loop through the records in a file that contains a list of batch COBOL program names. For each record in the file a call to the command file "ZCBL2GNT.CMD" will be made to do the actual compile. Depending on the results of the compile a "normal end-of-job" or "abnormal termination" message will be displayed and posted to the log file.
The default directives are specified in the OS390AscBatch.DIR file located in the "DIRS" sub-directory. The directives in this file are used unless a directives file with the same name as the program is found in the "DIRS" subdirectory.
For this example the load members is placed in the HOLD\GNTA sub-directory.
Creating the load members for the online environment is a three (3) step process. The third step is optional depending on the use of non-executable tables and the EXEC CICS LOAD command.
| ||||||
| Do the BMS Generation, Compile the Programs and Build other Load Members |
Note: the third step of the preceding list is optional depending on the use of the EXEC CICS LOAD command to load non-executable members (i.e. data tables).
This section will focus on the creation of the BMS load members and COBOL copy files for the BMS screens used by the online application. The command may be executed from Windows Explorer, called by another command file or from within a Windows Command prompt screen. The following shows the command line syntax.
C:\SIMOSAM1\DEVL\Adm1> BMGENAE1
The command will first call Env1Base to set the environment variables used by the various application build functions. Next, the Windows "FOR" command is used to loop through the records in a file that contains a list of source code for the BMS members. For each record in the file a call to the command file "BMGENAE1.CMD" will be made to do the actual BMS generation. Depending on the results of the generation a "normal end-of-job" or "abnormal termination" message will be displayed and posted to the log file.
For this example the load member is placed in the HOLD\BMSA sub-directory and the COBOL copy file is placed in the COBCPY6 sub-directory.
The "CBONLAE1.CMD" command file will be used to compile the COBOL programs used by the online applications. The command may be executed from Windows Explorer, called by another command file or from within a Windows Command prompt screen. The following shows the command line syntax.
C:\SimoSam1\DEVL\Adm1> CBONLAE1
The program will first call Env1Base to set the environment variables used by the various application build functions. Next, the Windows "FOR" command is used to loop through the records in a file that contains a list of online COBOL program names. For each record in the file a call to the command file "ZCBL2GNT.CMD" will be made to do the actual compile. Depending on the results of the compile a "normal end-of-job" or "abnormal termination" message will be displayed and posted to the log file.
The default directives are specified in the OS390AscOnline.DIR file located in the "DIRS" sub-directory. The directives in this file are used unless a directives file with the same name as the program is found in the "DIRS" subdirectory.
For this example the load members are placed in the HOLD\GNTA sub-directory.
The "ASMOGAE1.CMD" command file will be used to generate the non-executable load members used by the online applications. The command may be executed from Windows Explorer, called by another command file or from within a Windows Command prompt screen. The following shows the command line syntax.
C:\SimoSam1\DEVL\Adm1> ASMOGAE1
The script will first call Env1Base to set the environment variables used by the various application build functions. Next, the Windows "FOR" command is used to loop through the records in a file that contains a list of online Mainframe Assembler source members that use the DC statement to define non-executable tables. For each record in the file a call to the command file "ZASMOGEN.CMD" will be made to do the actual generation. Depending on the results of the generation a "normal end-of-job" or "abnormal termination" message will be displayed and posted to the log file.
For this example the load members are placed in the HOLD\MODA sub-directory.
This section provides additional detail about the tasks included in the scripted application build process.
The application build may be done on a development server with the executable members being placed in a staging area to be picked up by (or forwarded to) the system test group. This approach works well for small to mid-range environments. However, as the application grows in size and complexity additional controls or processes are required to insure that the executables going to production are built from a known base of source code. This includes all the side files for compiler options, directives and other specifications that will affect the behavior of the executables going into production.
In order to accomplish this it becomes necessary for the development group to submit the source code and control files to the test group. The first phase of the application or system testing will be to do a scripted build of the application and validate the results of the build process. Once the executables are generated the normal testing cycle begins.
The batch programs are divided into two (2) groups (or categories). The first group is batch programs without SQL syntax. The second groups is batch programs with SQL syntax.
The following is a listing of the command file (CBBATAE1.CMD) that does the multiple compilations of batch COBOL programs without SQL access. This script will read a file that contains a list of COBOL source members and call the "ZCBL2GNT.CMD" to do the actual generation for each source member in the list.
@echo OFF
echo *********************************************************************
echo * CBBATAE1.CMD - a Windows Command File *
echo * This program is provided by SimoTime Enterprises *
echo * (C) Copyright 1987-2011 All Rights Reserved *
echo * Web Site URL: http://www.simotime.com *
echo * e-mail: helpdesk@simotime.com *
echo *********************************************************************
rem *
rem * This command will read a file that contains a list of COBOL batch
rem * programs without SQL and call ZCBL2GNT to compile each member.
rem *
rem * This procedure calls the following Windows Command Files.
rem * 1. Env1Base.CMD - this provides a single point for setting commonly
rem * used environment variables.
rem * 2. SimoNOTE.CMD - this 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 compile of the specified program
rem *
rem * Note: To specifiy 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=CBBATAE1
rem *
call SimoNOTE "*******************************************%CmdName%.CMD"
call SimoNOTE "Starting JobName %CmdName%.CMD"
rem *
rem * Set the environment variable to use the default directives file.
set DirsLib1=%BaseLib1%\DIRS\ASC1
set zDIRS=%DirsLib1%\OS390AscCBLBAT.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
set EXTFH=%BASESYS%\CONFIG\EXTFHTAB.CFG
rem *
rem * Read the ListSam1CobolBatchLessExt.TXT file and pass the contents of each record to the
rem * command file that does the actual compile. Each record in the file
rem * contains an eight character program name.
set AOK_Count=0
set NOK_Count=0
set MemberList=%BaseLib1%\Adm1\DATA\UTIL\SIMOTIME.UTIL.CBLBATL1.LST
for /F "eol=; tokens=1,2* delims=." %%i in (%MemberList%) do call zCBL2GNT %%i COBOL HOLD\GNTA
rem *
call SimoNOTE "AOKcount Compile Count for AOK is %AOK_Count% "
call SimoNOTE "NOKcount Compile Count for NOK is %NOK_Count% "
if %NOK_Count% == 0 goto EOJAOK
goto EOJNOK
:EOJNOK
call SimoNOTE "ABENDING JobName %CmdName%.CMD"
goto EOJEND
:EOJAOK
call SimoNOTE "Finished JobName %CmdName%.CMD"
:EOJEND
if not "%SimoGENS%" == "BATCH" pause
endlocal
The following is a listing of the command file (CBBSQAE1.CMD) that does the multiple compilations of batch COBOL programs with SQL access. This script will read a file that contains a list of COBOL source members and call the "ZCBL2GNT.CMD" to do the actual generation for each source member in the list.
@echo OFF
echo *********************************************************************
echo * CBBSQAE1.CMD - a Windows Command File *
echo * This program is provided by SimoTime Enterprises *
echo * (C) Copyright 1987-2011 All Rights Reserved *
echo * Web Site URL: http://www.simotime.com *
echo * e-mail: helpdesk@simotime.com *
echo *********************************************************************
rem *
rem * This command will read a file that contains a list of COBOL batch
rem * programs with SQL and call ZCBL2GNT to compile each member.
rem *
rem * ************************************************************************
rem * This procedure calls the following Windows Command Files.
rem * 1. Env1Base.CMD - this provides a single point for setting commonly
rem * used environment variables.
rem * 2. SimoNOTE.CMD - this 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 compile of the specified program.
rem *
rem * Note: To specifiy 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=CBBSQAE1
set DirsLib1=%BaseLib1%\DIRS\ASC1
rem *
call SimoNOTE "****************************************%CmdName%.CMD"
call SimoNOTE "Starting JobName %CmdName%.CMD"
rem *
rem * Set the environment variable to use the default directives file.
set zDIRS=%DirsLib1%\OS390AscCBLBSQ.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
set EXTFH=%BASESYS%\CONFIG\EXTFHTAB.CFG
rem *
rem * Read the List-of-Members file and pass the contents of each
rem * record to the command file that does the actual compile. Each record
rem * in the file contains an eight character program name.
rem * The following parameters are passed to the called command file.
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 *
set AOK_Count=0
set NOK_Count=0
set MemberList=%BaseLib1%\Adm1\DATA\UTIL\SIMOTIME.UTIL.CBLBSQL1.LST
for /F "eol=; tokens=1,2* delims=." %%i in (%MemberList%) do CALL ZCBL2GNT %%i COBOLsq1 HOLD\GNTA
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 online load members are divided into three (3) groups (or categories). The first group contains the BMS (or screens) memers, the second groups contains the COBOL programs with EXEC CICS syntax and the third group contains the possible non-executable load members.
The following is a listing of the command file (BMGENAE1.CMD) that does the multiple generations of the BMS executable and COBOL copy file for the online environment. This script will read a file that contains a list of BMS source members and call the "ZBMSGENR.CMD" to do the actual BMS generation for each source member in the list.
@echo OFF
rem * ************************************************************************
rem * This procedure calls the following Windows Command Files.
rem * 1. Env1Base.CMD - this provides a single point for setting commonly
rem * used environment variables.
rem * 2. SimoNOTE.CMD - this provides a consistent process for displaying
rem * messages to the screen and writing to a journal or
rem * log file.
rem * 3. ZBMSGENR.CMD - this will do the generation of the specified member.
rem * ************************************************************************
setlocal
call ..\Env1Base
set CmdName=BMGENAE1
rem *
call SimoNOTE "**********************************************%CmdName%.CMD"
call SimoNOTE "Starting JobName %CmdName%.CMD"
rem *
rem * Read the file containing BMS Member names and pass the contents of each
rem * record to the command file that does the actual generation. Each record
rem * in the file contains an eight character member name. The following
rem * parameters are passed to the called command file.
rem * Parameter Description
rem * --------- ------------------------------------------------------------
rem * 1 Name of BMS source member
rem * 2 Name of BMS source directory relative to BaseLib1
rem * 3 Name of directory for BMS load member relative to BaseLib1
rem *
set AOK_Count=0
set NOK_Count=0
set MemberList=%BaseLib1%\Adm1\DATA\UTIL\SIMOTIME.UTIL.BMSMEML1.LST
for /F "eol=; tokens=1,2* delims=." %%i in (%MemberList%) do CALL ZBMSGENR %%i BMS HOLD\BMSA
rem *
call SimoNOTE "AOKcount Generate Count for AOK is %AOK_Count% "
call SimoNOTE "NOKcount Generate Count for NOK is %NOK_Count% "
if %NOK_Count% == 0 goto EOJAOK
goto EOJNOK
:EOJNOK
call SimoNOTE "ABENDING JobName %CmdName%.CMD"
goto EOJEND
:EOJAOK
call SimoNOTE "Finished JobName %CmdName%.CMD"
:EOJEND
if not "%SimoGENS%" == "BATCH" pause
endlocal
The following is the command file (ZBMSGENR.CMD) that does a single BMS generation from a single BMS source member. This command file is usually called from the "BMGENAE1.CMD" command file.
@echo OFF
set BMSgenerateStatus=0000
rem *
rem * It is the caller's responsibility to set BaseLib1 environment variable
rem * to the base directory. This procedure uses various sub-directories
rem * under the base directory.
rem *
rem * The following parameters are received from the calling command file.
rem * Parameter Description
rem * --------- ------------------------------------------------------------
rem * 1 Name of BMS source member
rem * 2 Name of BMS source directory relative to BaseLib1
rem * 3 Name of directory for BMS load member relative to BaseLib1
rem * Note The COBOL copy file will be written to the CobCpy6
rem * sub-directory under the BaseLib1 directory.
rem *
call SimoNOTE "* -------------------------------------------------------*ZBMSGENR.CMD"
call SimoNOTE "Starting JobStep ZBMSGENR, Status is %BMSgenerateStatus%, BMS Member is %1"
rem *
rem * ************************************************************************
rem * Do the BMS generation to create the .MOD Screen load member and the
rem * copy file to be used by a COBOL program.
rem * The copy file will be written to the CobCpy6 sub-directory under the
rem * base directory.
rem *
set CICSCPY=%BaseLib1%\CobCpy6\
mfbmscl %BaseLib1%\%2\%1.BMS /SYSPARM=MAP /SYSPARM=DSECT /COBOL=%CICSCPY% /BINARY=%BaseLib1%\%3\
if not ERRORLEVEL = 0 set BMSgenerateStatus=0010
if not "%BMSgenerateStatus%" == "0000" goto :Compile2GNTNOK
rem *
echo %BaseLib1%\%3\%1.MOD
if exist %BaseLib1%\%3\%1.MOD goto :Compile2GNTAOK
set BMSgenerateStatus=0020
goto :Compile2GNTNOK
rem *
rem * ************************************************************************
:Compile2GNTAOK
set /A AOK_Count=%AOK_Count% + 1
call SimoNOTE "BMS LOAD, %BaseLib1%\%3\%1.MOD"
call SimoNOTE "BMS COPY, %BaseLib1%\CobCpy6\\%1.CPY"
call SimoNOTE "Complete JobStep ZBMSGENR, Status is %BMSgenerateStatus%, BMS Member is %1"
goto :End
rem *
rem * ************************************************************************
:Compile2GNTNOK
set JobStatus=%BMSgenerateStatus%
set /A NOK_Count=%NOK_Count% + 1
call SimoNOTE "ABENDING JobStep ZBMSGENR, Status is %BMSgenerateStatus%, BMS Member is %1"
echo %1>%BaseLib1%\LOGS\%1.ERR
goto :End
rem *
rem * ************************************************************************
:End
The online programs are divided into two (2) groups (or categories). The first group is online programs are source members with EXEC CICS and without SQL syntax. The second groups is online programs are source members with EXEC CICS and with SQL syntax.
The following is a listing of the command file (CBONLAE1.CMD) that does the multiple compilations of the COBOL programs for the online environment. This script will read a file that contains a list of COBOL source members with EXEC CICS and without SQL statements. The command then calls a second command (ZCBL2GNT.CMD) to do the actual compile for each source member in the list.
@echo OFF
echo *********************************************************************
echo * CBONLAE1.CMD - a Windows Command File *
echo * This program is provided by SimoTime Enterprises *
echo * (C) Copyright 1987-2011 All Rights Reserved *
echo * Web Site URL: http://www.simotime.com *
echo * e-mail: helpdesk@simotime.com *
echo *********************************************************************
rem *
rem * This command will read a file that contains a list of COBOL online
rem * programs without SQL and call ZCBL2GNT to compile each member.
rem *
rem * This procedure calls the following Windows Command Files.
rem * 1. Env1Base.CMD - this provides a single point for setting commonly
rem * used environment variables.
rem * 2. SimoNOTE.CMD - this 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 compile of the specified program
rem *
rem * Note: To specifiy 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=CBONLAE1
rem *
call SimoNOTE "*******************************************%CmdName%.CMD"
call SimoNOTE "Starting JobName %CmdName%.CMD"
rem *
rem * Set the environment variable to use the default directives file.
set DirsLib1=%BaseLib1%\DIRS\ASC1
set zDIRS=%DirsLib1%\OS390AscCBLONL.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
set EXTFH=%BASESYS%\CONFIG\EXTFHTAB.CFG
rem *
rem * Read the ListSam1CobolBatchLessExt.TXT file and pass the contents of each record to the
rem * command file that does the actual compile. Each record in the file
rem * contains an eight character program name.
set AOK_Count=0
set NOK_Count=0
set MemberList=%BaseLib1%\Adm1\DATA\UTIL\SIMOTIME.UTIL.CBLONLL1.LST
for /F "eol=; tokens=1,2* delims=." %%i in (%MemberList%) do call zCBL2GNT %%i COBOLCS1 HOLD\GNTA
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 following is a listing of the command file (CBOSQAE1.CMD) that does the multiple compilations of the COBOL programs for the online environment. This script will read a file that contains a list of COBOL source members with EXEC CICS and with SQL statements. The command then calls a second command (ZCBL2GNT.CMD) to do the actual compile for each source member in the list.
@echo OFF
echo *********************************************************************
echo * CBOSQAE1.CMD - a Windows Command File *
echo * This program is provided by SimoTime Enterprises *
echo * (C) Copyright 1987-2011 All Rights Reserved *
echo * Web Site URL: http://www.simotime.com *
echo * e-mail: helpdesk@simotime.com *
echo *********************************************************************
rem *
rem * This command will read a file that contains a list of COBOL online
rem * programs with SQL and call ZCBL2GNT to compile each member.
rem *
rem * This procedure calls the following Windows Command Files.
rem * 1. Env1Base.CMD - this provides a single point for setting commonly
rem * used environment variables.
rem * 2. SimoNOTE.CMD - this 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 compile of the specified program
rem *
rem * Note: To specifiy 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=CBOSQAE1
rem *
call SimoNOTE "*******************************************%CmdName%.CMD"
call SimoNOTE "Starting JobName %CmdName%.CMD"
rem *
rem * Set the environment variable to use the default directives file.
set DirsLib1=%BaseLib1%\DIRS\ASC1
set zDIRS=%DirsLib1%\OS390AscCBLOSQ.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
set EXTFH=%BASESYS%\CONFIG\EXTFHTAB.CFG
rem *
rem * Read the ListSam1CobolBatchLessExt.TXT file and pass the contents of each record to the
rem * command file that does the actual compile. Each record in the file
rem * contains an eight character program name.
set AOK_Count=0
set NOK_Count=0
set MemberList=%BaseLib1%\Adm1\DATA\UTIL\SIMOTIME.UTIL.CBLOSQL1.LST
for /F "eol=; tokens=1,2* delims=." %%i in (%MemberList%) do call zCBL2GNT %%i COBOLCS1 HOLD\GNTA
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
Many online applications use data tables. These tables are usually defined in a COBOL copy file that is part of Working Storage. If the table changed the copy file was changed and all programs that used the copy file were re-compiled. If a table required frequent changes and was used by a number of different programs the use of the copy file became problematic. To solve this problem tables were coded as separate members and loaded at execution time using the EXEC CICS LOAD command. In order to create a non-executable load member the tables were coded in Mainframe Assembler using the DC (or Define Constant) statement.
This approach works quite well in the mainframe, EBCDIC-encoded environment were the Assembler Compiler is readily available. Also, this works quite well when moving the application to a Windows platform using Micro Focus Mainframe Express that provides support for EBCDIC encoding and a mainframe assembler capability.
The problem arises when the application is moved to a Windows or UNIX platform with Micro Focus Enterprise Server configured for an ASCII-encoded environment. To do this requires a special program that is capable of reading and parsing the DC statements in a mainframe assembler source member and creating an ASCII-encoding, non-executable load members. This program is available and described in a separate document.
The following is a list of the command file (ASMOGAE1.CMD) that does the multiple generations of non-executable load members for the online environment. This script will read a file that contains a list of assembler source members and call the "ZASMOGEN.CMD" to do the actual generation for each source member in the list.
@echo OFF
rem * ************************************************************************
rem * This procedure calls the following Windows Command Files.
rem * 1. Env1Base.CMD - this provides a single point for setting commonly
rem * used environment variables.
rem * 2. SimoNOTE.CMD - this provides a consistent process for displaying
rem * messages to the screen and writing to a journal or log file.
rem * 3. zModGeneration01.CMD - this will do the actual geberation of the
rem * specified member.
rem * ************************************************************************
setlocal
call ..\Env1Base
set CmdName=ASMOGAE1
rem *
call SimoNOTE "****************************************%CmdName%.CMD"
call SimoNOTE "Starting JobName %CmdName%.CMD"
set ASMOFORM=ASC
rem *
rem * Read the ListSam1AsModsLessExt.TXT file and pass the contents of each
rem * record to the command file that does the actual generation. Each
rem * record in the file contains an eight character member name.
for /F %%i in (ListSam1AsModsLessExt.TXT) do CALL ZASMOGEN %%i ASM HOLD\MODA LIST
rem *
call SimoNOTE "Finished JobName %CmdName%.CMD"
if not "%SimoGENS%" == "BATCH" pause
endlocal
The following is the command file (ZASMOGEN.CMD) that does a single MOD generation from a single Assembler source member. This command file is usually called from the "ASMOGAE1.CMD" command file.
@echo OFF
echo Parameter 1 is %1
echo CobCpy is %CobCpy%
set CreateMODStatus=0000
rem *
rem * It is the callers reponsibility to set BaseLib1 to the base
rem * directory. This procedure uses various sub-directories under the
rem * base directory.
rem *
rem * The following parameters are received from the calling command file.
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 * 4 Name of directory for list member relative to BaseLib1
rem *
rem * ************************************************************************
call SimoNOTE "Starting JobStep ZASMOGEN, Status is %CreateMODStatus%, Program is %1"
rem *
rem * ************************************************************************
rem * Do the build to create the .MOD non-executable using a COBOL program
set ASMOTAKE=%BaseLib1%\%2\%1.MLC
set ASMOMAKE=%BaseLib1%\%3\%1.MOD
set ASMOLIST=%BaseLib1%\%4\%1.LST
run ASMOGENR
echo ErrorLevel is %ERRORLEVEL%
if not "%ERRORLEVEL%" == "0" set CreateMODStatus=0010
if not "%CreateMODStatus%" == "0000" goto :CreateMODNOK
rem *
echo %ASMOMAKE%
if exist %ASMOMAKE% goto :CreateMODAOK
set CreateMODStatus=0020
goto :CreateMODNOK
rem *
rem * ************************************************************************
:CreateMODAOK
call SimoNOTE "StepInfo Create Hex Dump File of .MOD file"
set SYSLOG=%BaseLib1%\DATA\Wrk1\%1.DMP
if exist %SYSLOG% del %SYSLOG%
run SimoZAPS Hexcess %ASMOMAKE% start=1 stop=9999999
call SimoNOTE "Complete JobStep ZASMOGEN, Status is %CreateMODStatus%, Program is %1"
goto :End
rem *
rem * ************************************************************************
:CreateMODNOK
set JobStatus=%Compile2GNTStatus%
call SimoNOTE "ABENDING JobStep ZASMOGEN, Status is %CreateMODStatus%, Program is %1"
echo %1>%BaseLib1%\LOGS\%1.ERR
goto :End
rem *
rem * ************************************************************************
:End
exit /B %CreateMODStatus%
For the SimoTime suite of sample programs the "C:\SimoSam1" directory is the primary (or base) directory with three (3) sub-directories DEVL, PROD and TEST. The following shows the next level of sub-directories under the DEVL directory (the PROD and TEST or similar).
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Note-1: This is the primary root directory, for this example it is set to C:\SIMOSAM1. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Note-2: This is the Development, Production or Test directory, for this example it is set to DEVL. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Note-3: Utility programs using a mainframe dialect, not part of application code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Note-4: Utility programs using a Micro Focus dialect, not part of application code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Note-5: Utility programs with specialized or unique requirements | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The Directory Structure used in the Workshop for Micro Focus Studio Enterprise Edition |
The preceding is provided for reference purposes and may be modified to meet specific requirements or naming conventions. Additional sub-directories that address requirements beyond the scope of the scripted build process may be in the base directory. The use of additional sub-directories is described in documents that address additional requirements and functionality.
This section provides additional detail about the application build process.
Compiler directives may be individually specified in the source code of a COBOL program, as part of a Net Express project or grouped together in a directives file that may be referenced by the project or command that is doing the compile. For most of the compiles this suite of examples uses directives files, two for the batch environment and two for the online environment. The following sections describe each in more detail.
When the NOFORM directive is used the listing will be created without print carriage control and page headers. This makes for easier viewing from the screen and produces a listing file with the included copy files. This listing file could be renamed with a .CBL extension and compiled.
Note: the NOFORM directive must follow the LIST() directive. The LIST directive will set FORM"60".
This link provides additional detail about the Compiler Directives for Micro Focus and the following sections are included in this document as a convenience.
The following (OS390AscCBLBAT.DIR) is a listing of the DIR file used when compiling COBOL batch programs for an ASCII-encoded environment. These are programs without "EXEC CICS" and without "EXEC SQL" syntax.
DIALECT"OS390" CHARSET"ASCII" ASSIGN"EXTERNAL" IDXFORMAT"8" IBMCOMP NOTRUNC HOSTNUMMOVE HOSTNUMCOMPARE NOSIGNFIXUP HOSTARITHMETIC CHECKNUM NOOPTIONAL-FILE NOHOSTFD NOQUERY COBIDY ANIM outdd"SYSOUT 121 L" SHARE-OUTDD DATAMAP settings list() noform
The following (OS390AscCBLBSQ.DIR) is a listing of the DIR file used when compiling COBOL batch programs for an ASCII-encoded environment. These are programs without "EXEC CICS" and with "EXEC SQL" syntax.
DIALECT"OS390" CHARSET"ASCII" SQL(DBMAN=ODBC) SQL(ALLOWNULLCHAR) SQL(DB=CUSTACC1) SQL(PASS) SQL(INIT=PROT) SQL(THREAD=ISOLATE) SQL(TARGETDB=DB2) SQL(BEHAVIOR=MAINFRAME) WARNING"1" IBMCOMP NOTRUNC HOSTNUMMOVE HOSTNUMCOMPARE NOSIGNFIXUP HOSTARITHMETIC CHECKNUM NOOPTIONAL-FILE NOHOSTFD NOQUERY COBIDY ANIM outdd"SYSOUT 121 L" SHARE-OUTDD DATAMAP SETTING"COL3" list() noform
The following (OS390AscCBLONL.DIR) is a listing of the DIR file used when compiling COBOL onlne programs for an ASCII-encoded environment. These are programs with "EXEC CICS" and without "EXEC SQL" syntax.
DIALECT"OS390" CHARSET"ASCII" CICSECM() IBMCOMP NOTRUNC HOSTNUMMOVE HOSTNUMCOMPARE NOSIGNFIXUP HOSTARITHMETIC CHECKNUM NOQUERY COBIDY ANIM outdd"SYSOUT 121 L" SHARE-OUTDD DATAMAP settings list() noform
The following (OS390AscCBLOSQ.DIR) is a listing of the DIR file used when compiling COBOL onlne programs for an ASCII-encoded environment. These are programs with "EXEC CICS" and with "EXEC SQL" syntax.
DIALECT"OS390" CHARSET"ASCII" SQL(DBMAN=ODBC) SQL(ALLOWNULLCHAR) SQL(DB=CUSTACC1) SQL(PASS) SQL(INIT=PROT) SQL(THREAD=ISOLATE) SQL(TARGETDB=DB2) SQL(BEHAVIOR=MAINFRAME) WARNING"1" CICSECM() IBMCOMP NOTRUNC HOSTNUMMOVE HOSTNUMCOMPARE NOSIGNFIXUP HOSTARITHMETIC CHECKNUM NOQUERY COBIDY ANIM outdd"SYSOUT 121 L" SHARE-OUTDD DATAMAP settings list() noform
The following is the command file (ZCBL2GNT.CMD) that does a single compile from a single COBOL source member. This command file is usually called from another command file such as the "CBBATAE1.CMD" command file for batch programs and the "CBONLAE1.CMD" command file for online programs.
echo Parameter 1 is %1
echo CobCpy is %CobCpy%
set Compile2GNTStatus=0000
rem *
rem * It is the callers reponsibility to set BaseLib1 to the base
rem * directory. This procedure uses various sub-directories under the
rem * base directory.
rem *
rem * The following parameters are received from the calling command file.
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 * ************************************************************************
rem * The following two statements will first set the compile options to use
rem * the directives file specified in the zDIRS environment variable. The
rem * second statement will then check for a .DIR file with the same name as
rem * the program. If this exists then it will override zDIRS value.
set CompileOptions=%zDIRS%
if exist %DirsLib1%\%~n1.DIR set CompileOptions=%DirsLib1%\%~n1.DIR
call SimoNOTE "Starting zCompileToGnts01, Status is %Compile2GNTStatus%, Program is %1"
echo Compile Options = %CompileOptions%
call SimoNOTE "InfoNote %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 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%\ProdLib1\%1.GNT)
if "%EraseAfter%"=="Y" (echo Erase After is ENABLED
ERASE %BaseLib1%\%3\%1.GNT)
call SimoNOTE "Complete zCompileToGnts01, Status is %Compile2GNTStatus%, Program is %1"
goto :End
rem *
rem * ************************************************************************
:Compile2GNTNOK
set JobStatus=%Compile2GNTStatus%
call SimoNOTE "ABENDING zCompileToGnts01, Status is %Compile2GNTStatus%, Program is %1, !!!ATTENTION!!!"
echo %1 - Error during Compile, refer to %BaseLib1%\LIST\%1.LST>%BaseLib1%\LOGS\%1.ERR
goto :End
rem *
rem * ************************************************************************
:End
A 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 Enterprises *
rem * (C) Copyright 1987-2012 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 Enterprises
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 BaseLib1=c:\SimoSAM1\DEVL
set BaseLib8=c:\SimoSAM8
set SAM1ANIM=C:\SIMOSAM1\DEVL\SAM1SOL1\SAMBATG1\bin\x86\Debug
set BASEAPP=%BaseLib1%
set BASESYS=%BaseLib1%\SYS1
set BASECAT=%BaseLib1%\DATA
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\SYSOUT_SIMONOTE.TXT
set SimoNOTE=%BASEAPP%\LOGS\SYSOUT_SIMONOTE.TXT
set MIFOBASE="C:\Program Files (x86)\Micro Focus\Studio Enterprise Edition 6.0\Base"
set MIFOBIN=%MIFOBASE%\bin
rem *
set SimoLIBR=c:\SimoLIBR
set JESSERVERNAME=SIMOBATA
rem * set SIMOMODE=PAUSE
rem *
set MAINFRAME_FLOATING_POINT=true
set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy6;c:\SimoLIBR;%MIFOBASE%\SOURCE
set COBIDY=%BASEAPP%\COBIDY
rem * For large file support and record locking control of File Handler
set EXTFH=%BASESYS%\CONFIG\EXTFHBIG.CFG
rem * For Sort Resource Allocation and Performance
set SORTSPACE=1000000
set ES_ALLOC_OVERRIDE=%BASESYS%\CONFIG\CATMAPA1.cfg
set COBCONFIG_=%BASESYS%\CONFIG\diagnose.cfg
rem * Set environment for MFBSI (Micro Focus Batch Scheduling Interface)
set ES_EMP_EXIT_1=mfbsiemx
set MFBSI_DIR=%BASESYS%\LOGS\%ezServerName%
set MFBSIEOP_CMD=ENABLE
set MFBSIEOP_CSV=ENABLE
set MFBSIEOP_HTM=ENABLE
set MFBSIEOP_XML=ENABLE
rem * Set Behavior and Trace Flags for GETJOBDD
set JDDFLAGS=nnnWnnnn/nnnnnnnn
rem *
if "%SIMOPATH%" == "Y" goto JUMPPATH
set path=%MIFOBASE%;%MIFOBIN%;%PATH%;
set COBPATH=.;%BASEAPP%\LOADLIB;%BASESYS%\LOADLIB;C:\SimoLIBR
set LIBPATH=.;%BASEAPP%\LOADLIB;%BASESYS%\LOADLIB;C:\SimoLIBR
set TXDIR=%BASESYS%\LOADLIB;%MIFOBASE%
:JUMPPATH
set SIMOPATH=Y
set JobStatus=0000
call SimoNOTE "* Settings CmdName Env1BASE.CMD, Version 10.04.19"
call SimoNOTE "* BaseAPP is %BASEAPP%"
Note: For the SimoTime suite of sample programs this command is located in the base directory named SimoSam1
The following is a listing of the contents of the (SIMONOTE.CMD) command file.
@echo OFF rem * ******************************************************************* rem * This program is provided by SimoTime Enterprises * rem * (C) Copyright 1987-2012 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 Enterprises 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
This section provides information that addresses specific items pertaining to the function and capabilities and their potential use within or beyond the author's original design objectives.
This section is a list of frequently asked questions preceded by a date stamp.
| ||||||
| Frequently Asked Questions |
The purpose of this program is to provide a model suite of Windows Command Files to do a scripted build of an application that has been migrated from a Mainframe System to a Windows System using Micro Focus Enterprise Server or Mainframe Express..
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 documents and the links to other documents are intended to provide a choice of alternatives.
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 expressed 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.
This section includes links to documents with additional information that is beyond the scope and purpose of this document. The first sub-section requires an internet connection, the second sub-section references locally available documents.
Note: A SimoTime License is required for the items to be made available on a local server.
The following links will require an internet connect. This section includes links to documents with additional information that is beyond the scope and purpose of this document.
Download this evaluation package that describes and demonstrates a Scripted Application Build Process that is used with Micro Focus Studio running in a Windows environment.
Explore an Extended List of Software Technologies that are available for review and evaluation. The software technologies (or Z-Packs) provide individual programming examples, documentation and test data files in a single package. The Z-Packs are usually in zip format to reduce the amount of time to download.
A good place to start is The SimoTime Home Page for access to white papers, program examples and product information.
Note: You must be attached to the Internet to download a Z-Pack or view the list.
The following links may be accessible without an internet connection.
Note: A SimoTime License is required for the items to be made available on a local server.
Explore The File Status Return Codes to interpret the results of accessing VSAM data sets and QSAM files.
Check out The SimoTime Glossary for a list of terms and definitions used in the documents provided by SimoTime.
This document was created and is maintained by SimoTime Enterprises.
If you have any questions, suggestions, comments or feedback please call or send an e-mail to: helpdesk@simotime.com
We appreciate hearing from you.
Founded in 1987, SimoTime Enterprises 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. 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 |
| Scripted Application Build for the Micro Focus Environment |
| Copyright © 1987-2012 SimoTime Enterprises All Rights Reserved |
| When technology complements business |
| http://www.simotime.com |