Java and COBOL
The Best of Both Worlds
  Table of Contents  v-16.01.01 - docsj001.htm 
  Introduction
  Continue with Business as Usual
  Rewrite using Java
  Using both Java and COBOL
  The Micro Focus COBOL Environment
  The Java Environment by Oracle
  Apache Tomcat Web Server
  Running the Application Examples
  Display the Application Menu
  Customer Inquiry
  Customer Registration
  Write Me a Check
  Show Me the Date
  What is My Age
  Show Me the Hexadecimal Dump
  System Information
  The Directory Structure
  Set the Environment
  Set Shared Environment Variables
  Set Java Environment Variables
  Development and System Tasks
  Compile and Link the COBOL Programs
  Primary Command for COBOL Compile
  Secondary Command for COBOL Compile
  Compile the Java Programs
  Primary Command for Java Compile
  Secondary Command for Java Compile
  Start the Apache Tomcat Web Server
  Shutdown the Apache Tomcat Web Server
  Application Structure and Design
  Customer Inquiry
  Customer Registration
  Write Me a Check
  Show Me the Date
  What is My Age
  Show Me the Hexadecimal Dump
  Possibilities & Limitations
  ASCII and EBCDIC Translation
  Expanded Help Text
  Numeric Fields
  Alpha-Numeric Fields, Truncate Spaces
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Comments or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This web application demonstrates the use of Java Server Pages (including JSP tags, HTML and JavaScript), Java Beans, Applets, Scriptlets and COBOL programs working together in a mixed-language environment. The purpose of this suite of sample programs is to provide practical examples and possible solutions for individuals that will be creating Internet applications that may require complementary processing with a mainframe. This suite of sample programs also executes on an application server that functions independent of the mainframe.

Note:  We are currently in the process of updating this application suite to use Apache Tomcat.

For example, this application suite accesses a local data set that was downloaded from a mainframe in EBCDIC format. The program could make a connection to a Mainframe to access the data set that is a VSAM Keyed, Sequential Data Set (KSDS). An example of converting between ASCII and EBCDIC is also provided in the data access member.

This set of programs was created and/or downloaded from a mainframe system as a result of a "Discovery Session and Proof-of-Concept" project to determine the feasibility and possible approaches of extending mainframe application functionality to the Internet. The initial analysis reduced the focus to the following three possibilities.

Item Description
1 Continue with Business as usual.
2 Rewrite the application using Java.
3 Use Java for the Internet front-end and reuse as many of the existing COBOL programs as possible.
  Top Three Choices for a Possible Solution

One of the goals was to complete the "Discovery Session and Proof-of-Concept" within fifteen (15) days. This required a focus on a sampling of typical routines used in the mainframe application. Six functions were selected and the corresponding mainframe COBOL programs were downloaded from the Mainframe System running ZOS to a Windows System running a Micro Focus Enterprise Server.

The "Java Rewrite" numbers are estimates. The time estimates to rewrite exceeded the scope of the "Discovery Session and Proof-of-Concept". An attempt was made to access the data base for the "Customer Inquiry" function using Java. It was quickly determined that Java does not have native support for Indexed or Keyed files. Converting the data base to a relational data base was discussed. This is a possibility but was not included as part of this project.

Description of Function Create JSP Java API COBOL Reuse Java Rewrite
Access a Data Base 0.50 0.50 0.25 3.00
Write to a Journal or Log File 0.75 0.50 0.25 1.50
Create a Text String from Numbers 0.50 0.50 0.25 4.50
Date Validation-Conversion-Formatting 0.50 0.75 0.25 5.00
Date Difference Routine 0.50 0.50 0.25 2.00
Hex-Dump Routine for Debugging 0.50 0.50 0.25 5.00
Total Number of Days 3.25 3.25 1.50 21.00

Note:  The technical evaluation phase took eight days. Doing the documentation took an additional four days.


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

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

Table of Contents Previous Section Next Section Continue with Business as Usual

This complete online business function is not being replaced. The current use of mainframe terminals by trained employees will continue. The "application extension" to allow customers to view and possibly update their information via the Internet will be a subset of the complete business function. The complete business function could be ported to the Internet or an Intranet but this should be a second phase or separate project.

Also, it should be noted that providing access to business functions by individuals outside a company may require a much higher level of usability than the current legacy systems provides. It should not be assumed that what can be accomplished within a company by a skilled employee can be easily mastered by a first time user that is not familiar with the application. Improved messages will be needed when an individual does not follow the business rules. Readily available help text will be a requirement when moving to the Internet.

Table of Contents Previous Section Next Section Rewrite using Java

The size and complexity of the examples in this project were small in comparison with the size and complexity of some of the legacy programs running critical business functions on the host system. Re-writing everything in Java for the Internet could not be done within the business time frame and cost objectives.

Table of Contents Previous Section Next Section Using both Java and COBOL

This option requires a teaming of both COBOL and Java programmers. An individual that is familiar with the techniques of providing documentation in a hypertext environment should be part of the team. Also, the software vendor that provides the API for the different languages should be included as part of the team. For this project the Micro Focus involvement was essential in order to meet the target date.

Table of Contents Previous Section Next Section The Micro Focus COBOL Environment

This application requires Enterprise Developer or Visual COBOL, version 2.2.

Micro Focus Enterprise Developer or Visual COBOL brings the productivity and collaboration of modern, industry-leading Integrated Development Environments (IDEs) to core COBOL systems – including deploying key business-critical COBOL applications to Windows, UNIX, Linux, .NET, JVM and the cloud.

Explore the Micro Focus Web Site via an Internet Connection for more information about products and services available from Micro Focus.

Table of Contents Previous Section Next Section The Java Environment by Oracle

Oracle acquired Sun Microsystems in 2010, and since that time Oracle's hardware and software engineers have worked side-by-side to build fully integrated systems and optimized solutions. Sun's software portfolio has continued to develop as well, with new releases of Oracle Solaris, MySQL, and the recent introduction of Java 7.

Micro Focus Visual COBOL brings the productivity and collaboration of modern, industry-leading Integrated Development Environments (IDEs) to core COBOL systems – including deploying key business-critical COBOL applications to Windows, UNIX, Linux, .NET, JVM and the cloud.

For more information refer to the Java Information provided by Oracle and Sun Microsystems Web Site.

Table of Contents Previous Section Next Section Apache Tomcat Web Server

Apache Tomcat (or Tomcat, formerly Jakarta Tomcat) is an open source web server and servlet container developed by the Apache Software Foundation (ASF). Tomcat implements the Java Servlet and the JavaServer Pages (JSP) specifications from Sun Microsystems. Tomcat provides a "pure Java" HTTP web server environment for Java code execution.

Table of Contents Previous Section Next Section Running the Application Examples

This section contains a description of "how to" use the applications provided within this demonstration package. A detailed specification for how each application is structured is provided in the System Information section of this document.

This suite of "Application Examples" contains a menu-of-applications page, six mini-applications and the documentation or help text. To display the menu the local Web Server must be started (refer to the Starting the Apache Web Server section of this document).

To display the menu-of-applications page select the Net Express, "COBOL and Java Project" icon from the desktop.

Table of Contents Previous Section Next Section Display the Application Menu

The following (EZJVMENU.cmd) is the Windows Command File used to display the primary menu screen for the application examples.

@echo OFF
rem  * *******************************************************************
rem  *               EZJVMENU.cmd - a Windows Command File               *
rem  *       This Job Script 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 Demo Menu.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * *******************************************************************
rem  * Step 1, Set the Environment...
rem  *
     set CmdName=EZJVMENU
     call ..\ENV1BASE %CmdName%
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
     set JobStatus=0000
     cd\
     cd %BASELIB1%\LOADLIB
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting CmdName %CmdName%"
rem  *
rem  * *******************************************************************
rem  * Step 2, Display Menu Page, menuj001.htm ...
rem  *
     call SimoNOTE "* CATALINA_HOME ... %CATALINA_HOME%"
     call SimoNOTE "* JRE_HOME ........ %JRE_HOME%"
     call SimoNOTE "* CLASSPATH ....... %CLASSPATH%"
     call SimoNOTE "* SYSOUT .......... %SYSOUT%"
     call SimoNOTE "* Bulletin Display the Menu Page"
rem     C:\Users\Larry\AppData\Local\Google\Chrome\Application\chrome.exe http://localhost:8080/tomcat/tomcat
rem     start C:\Users\Larry\AppData\Local\Google\Chrome\Application\chrome.exe %BASELIB1%\WEBPAGES\menuj001.htm
rem     start C:\Users\Larry\AppData\Local\Google\Chrome\Application\chrome.exe   http://localhost:8080/simotcat/menuj001.htm
     start "c:\Program Files (x86)\Google\Chrome\Application\chrome.exe"   http://localhost:8080/simotcat/menuj001.htm
rem     "c:\Program Files (x86)\Internet Explorer\iexplore" C:\AC2014\SP02\DEVL\JAVA\menuj001.htm
     if not ERRORLEVEL = 0 set JobStatus=0010
     if not %JobStatus% == 0000 goto :EojNok
:EojAok
     call SimoNOTE "Simonote JobName %CmdName%, Display Menu using Chrome Browser"
     call SimoNOTE "Finished JobName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNok
     call SimoNOTE "ABENDING JobName %CmdName%, Job Status is %JobStatus%"
:End
     if not "%1" == "nopause" pause

Table of Contents Previous Section Next Section Customer Inquiry

To retrieve customer information simply type a six-digit customer number and press the  Continue  button.

The local Data Base contains twenty-six (26) records. The Customer numbers are six digits. Valid customer numbers are 00nn00 where nn is 01-26.

If a valid customer key is requested the name, address, city, state/province and postal code will be displayed. Otherwise, a message will be displayed.

Refer to the System Information, Customer Inquiry, Structure and Design section of this document for detailed specifications.

Table of Contents Previous Section Next Section Customer Registration

This section describes how to use the "Customer Registration" option to save information that has been typed by the user.

Refer to the System Information, Customer Registration, Structure and Design section of this document for detailed specifications.

Table of Contents Previous Section Next Section Write Me a Check

To display a check image simply type a name and an amount and press the  Do a Check  button. The numeric amount will be subjected to "reasonability" checks.

If the amount is "reasonable" a check image will be displayed with both a numeric and a converted text string showing the amount. Otherwise, a message will be displayed.

Refer to the System Information, Write me a Check, Structure and Design section of this document for detailed specifications.

Table of Contents Previous Section Next Section Show Me the Date

This example will prompt a user for a date in the ccyymmdd format. The user types a date and clicks on the  Vali-DATE  button. The user date will then be processed by the date validation and editing routine.

If the user date is valid (i.e. meets the reasonability checks) the various date formats are displayed. Otherwise, an error message will be displayed.

The following is an example of the contents of the input or date-card.

DATECARD 2000/04/01

The following is an example of the date information provided by the date routine.

Gregorian Date .............. 20000401
Edited Gregorian Date ....... 2000-04-01
Text for the Date............ April 1, 2000
Julian Date ................. 2000092
Days remaining in the year .. 274
Leap Year Flag (Y or N) ..... Y
Days in the Month ........... 30
Text for the Month .......... April

Refer to the System Information, Show Me the Date, Structure and Design section of this document for detailed specifications.

Table of Contents Previous Section Next Section What is My Age

This example will prompt a user for a date of birth in the ccyymmdd format. The user types a date and clicks on the  Calculate Age  button. The number of days since the user's birth date and today's date will then be calculated and the results displayed.

If the user birth date is valid (i.e. meets the reasonability checks) the difference in days will be displayed. Otherwise, an error message will be displayed.

Refer to the System Information, What is my Age, Structure and Design section of this document for detailed specifications.

Table of Contents Previous Section Next Section Show Me the Hexadecimal Dump

This example will prompt a user for a text string. The user types a maximum of sixteen (16) characters and clicks on the  Do HexDump  button. The contents of the text string will be converted to a hexadecimal dump format and this will be displayed at the Server console and be written to the SYSLOG file.

Refer to the System Information, Show Me the Hexadecimal Dump, Structure and Design section of this document for detailed specifications.

Table of Contents Previous Section Next Section System Information

The purpose of this section is to provide additional information for the Help Desk and programming support staff.

Table of Contents Previous Section Next Section The Directory Structure

The following diagram shows the model sub-directory structure for the Application Libraries and the DEVELOPMENT environment. The Application Libraries are typically a sub-directory under a directory structure for a Development, Production or Test environments. Update or change capability to the Application Library structure and content may be limited to system and support individuals. Read or view access typically has a larger audience.

               
SIMOSAM1
See Note-1
   
   
 
 
DEVL
See Note-2
   
   
 
 
ADM1
 
 
and MORE
Administrative and Support functions
   
   
 
 
ASM
 
 
and MORE
Mainframe Assembler Source and Sub-Directories
   
   
 
 
BMS
Contains Basic Mapping Support Member
   
   
 
 
COBCPY1
Contains COBOL Copy Members
   
   
 
 
COBCPY6
Contains COBOL Copy Members from a BMS GEN
   
   
 
 
COBOL
Contains COBOL Source Members
   
   
 
 
COBOLUT1
Contains COBOL Source Members, see Note-3
   
   
 
 
COBOLUT2
Contains COBOL Source Members, see Note-4
   
   
 
 
COBOLUT3
Contains COBOL Source Members, see Note-5
   
   
 
 
DATA
Contains the catalog and data files
   
   
   
   
 
 
APPL
Contains non-Relational data files for Application
   
   
   
   
 
 
SPOOL
Contains the JES and SYSOUT files
   
   
   
   
 
 
and MORE
Link to additional sub-Directories
   
   
 
 
DIRS
Contains compiler directives files
   
   
 
 
DOCS
Contains user or application documentation
   
   
 
 
HOLD
 
 
and MORE
Contains new load members from Scripted Builds
   
   
 
 
IMSLIB
Contains the IMS Members for execution-time
   
   
   
   
 
 
DBD
Source Members for the IMS DBD
   
   
   
   
 
 
PSB
Source Members for the IMS PSB
   
   
 
 
JAVA
Contains JAVA Source Members
   
   
 
 
JCL
Contains the JCL Source Members
   
   
 
 
JCLINC
Contains the Include Members for JCL
   
   
 
 
LOADLIB
Contains the executable members
   
   
   
   
 
 
simpacks
Contains Java Class Members
   
   
 
 
LOGS
Contains the log files for the application
   
   
 
 
PARMLIB
Contains the parameter or control files
   
   
 
 
PROCLIB
Contains the Procedures (or PROC's) for JCL
   
   
 
 
REXXLIB
Contains the REXX Program Members
   
   
 
 
SIMOGENS
 
 
and MORE
Contains the Program Generation Members
   
   
 
 
SYS1
Systems directory, not exposed to users
   
   
 
 
CONFIG
System configuration specifications
   
   
 
 
and MORE
Link to additional sub-Directories…
 
Note-1: This is the primary directory for the SimoTime Driver Programs and Test Cases
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 business functions
Note-4: Utility programs using a Micro Focus dialect, not part of application business functions
Note-5: Utility programs with specialized or unique requirements
The Directory Structure used in the in the SimoTime Development Environment

Color Associations: The  light-green  boxes are unique to SIMOTIME Technologies using an IBM Mainframe System or Micro Focus Enterprise Developer. The  light-red  boxes are unique to the SIMOTIME Technologies using a Linux, UNIX or Windows System and COBOL Technologies such as Micro Focus. The  light-yellow  boxes are SIMOTIME Technologies, Third-party Technologies, decision points or program transitions in the processing logic or program generations. The  light-blue  boxes identify the input/output data structures such as Documents, Spreadsheets, Data Files, VSAM Data Sets, Partitioned Data Set Members (PDSM's) or Relational Tables. The  light-gray  boxes identify a system function or an informational item.

Table of Contents Previous Section Next Section Set the Environment

This section describes the two Windows commands used to set the environment. The first command will set the common or shared environment variables used (or called) by many other commands in this suite of programs. The second command will set the environment variables that are unique to the Java environment.

Table of Contents Previous Section Next Section Set Shared Environment Variables

The following (ENV1BASE.cmd) is the Windows Command File used to set the environment variables that are shared across many of the application and system functions.

@echo OFF
rem  * *******************************************************************
rem  *               ENV1BASE.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   - 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
     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  *
rem  * Set the Environment for the Java Environment...
     set JAVABASE=C:\Program Files (x86)\Java\jdk1.8.0_112
     set JAVASDK="%JAVABASE%\bin"
     set JAVA_HOME=%JAVABASE%
     set JRE_HOME=%JAVABASE%
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
     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  *
     set MAINFRAME_FLOATING_POINT=true
     set COBIDY=%BASEAPP%\COBIDY
     set COBPATH=.;%BASEAPP%\LOADLIB;%BASESYS%\LOADLIB;%SimoLIBR%
     set LIBPATH=.;%BASEAPP%\LOADLIB;%BASESYS%\LOADLIB;%SimoLIBR%
     set TXDIR=%BASESYS%\LOADLIB;%MIFOBASE%
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%
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;%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 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
     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%\mfcobol.jar
rem  *
     set JobStatus=0000
     call SimoNOTE "* Settings CmdName ENV1BASE.cmd, Version 18.09.15, %MIFOSYS1%"
     call SimoNOTE "* BaseAPP ..... %BASEAPP%"
rem *      call SimoNOTE "* MFBSIDIR .... %MFBSI_DIR% "
     call SimoNOTE "* MIFOSYS1 is %MIFOSYS1% "
     call SimoNOTE "* MIFOBASE is %MIFOBASE% "
     call SimoNOTE "* SIMOLIBR is %SIMOLIBR% "

Table of Contents Previous Section Next Section Set Java Environment Variables

The following (ENV1JAVA.cmd) is the Windows Command File used to set the environment variables that are required by the Java Development or Run Time sub-system.

@echo off
     call SIMONOTE "* ENV1JAVA is STARTING... "
rem  *
rem  * The following statement will cause the COBOL programs to
rem  * be compiled with ANIMATION enabled.
rem  *
     set jlibenv=YES
     call SIMONOTE "* JAVABASE is %JAVABASE% "
rem  *
     set USERCLASS=%BASELIB1%\LOADLIB
     set APACHEST=C:\Program Files (x86)\Apache Group\Apache2
     set CLASSPATH=.
     set CLASSPATH=%CLASSPATH%;%JAVABASE%
     set CLASSPATH=%CLASSPATH%;%JAVABASE%\lib
     set CLASSPATH=%CLASSPATH%;\%USERCLASS%
     set CLASSPATH=%CLASSPATH%;C:\APACHETC\apache-tomcat-7.0.52\webapps\ap01jv01\WEB-INF\classes
     set CLASSPATH=%CLASSPATH%;C:\APACHETC\apache-tomcat-7.0.52\webapps\ap01jv01\WEB-INF\classes\simpacks
     set CLASSPATH=%CLASSPATH%;C:\Program Files (x86)\Micro Focus\Visual COBOL\bin
rem  *
     SET  CUSTMAST=%BASELIB1%\DATA\APPL\ebc00256.ksd
rem  *
     SET  SYSLOG=%BASELIB1%\DATA\APPL\syslog.txt
     if   not exist %SYSLOG% echo * SYSLOG creation . . . >%SYSLOG%
rem  *
     SET  SYSJRNL=%BASELIB1%\DATA\APPL\sysjrnl.txt
     if   not exist %SYSJRNL% echo * SYSJRNL creation...>%SYSJRNL%
rem  *
     call SIMONOTE "* ENV1JAVA is Finished... "

Table of Contents Previous Section Next Section Development and System Tasks

This section will describe the development tasks for compiling the COBOL and Java programs and the System tasks for starting and stopping i.e. shutdown) of the Apache Tomcat Web Server.

Table of Contents Previous Section Next Section Compile and Link the COBOL Programs

The process to compile and link the COBOL programs uses two command files and a list of COBOL source members. The primary command reads the list file and for each record in the list file a call is made to the secondary command to do the COBOL compile and link.

Table of Contents Previous Section Next Section Primary Command for COBOL Compile

The following (CBBLDLW1.cmd) is the primary Windows Command File for the COBOL compile and link. This command uses a Windows "FOR" command to read a list file of COBOL source member names and does a call to a secondary command to do a COBOL compile and link for each member in the list.

@echo OFF
echo *********************************************************************
echo *              CBBLDLW1.CMD - a Windows Command File                *
echo *        This program is provided by SimoTime Enterprises           *
echo *           (C) Copyright 1987-2014 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. CBBLDLW8.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=CBBLDLW1
     set JobStatus=0000
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=ZDIRNOAN.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 TransferDLL=N
     set EraseAfter=N
     set EraseOBJ=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 SLIB1=%BASELIB1%\JAVA
     set TLIB1=%BASELIB1%\JAVA
     set AOK_Count=0
     set NOK_Count=0
     set MemberList=CBL_MBRS.txt
     for /F "eol=; tokens=1,2* delims=." %%i in (%MemberList%) do call CBBLDLW8 %%i
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
pause

Table of Contents Previous Section Next Section Secondary Command for COBOL Compile

The following (CBBLDLW8.cmd) is the secondary Windows Command File for the COBOL compile and link. This command will execute the "CBLLINK" program to compile and link a single COBOL program based on the source member name specified as the first parameter.

rem  * *******************************************************************
rem  *               CBBLDLW8.cmd - a Windows Command File               *
rem  *         This program is provided by SimoTime Enterprises          *
rem  *           (C) Copyright 1987-2014 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  *    4.      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 rem  * the program.
rem  * If this exists then it will override zDIRS value.
rem  *
rem  *
     echo Parameter 1 is %1
     echo CobCpy is %CobCpy%
     set Compile2DLLStatus=0000
     set CompileOptions=%zDIRS%
     if exist %BaseLib1%\DIRS\%1.DIR set CompileOptions=%BaseLib1%\DIRS\%1.DIR
     call SIMONOTE "CBBLDLW8 is executing"
     call SimoNOTE "COBCPY is %COBCPY%"
     call SimoNOTE "Directory file is %CompileOptions%"
rem  *
rem  * The -bbs will
rem  * The -rE will cause the exectable to link with the current run time.
rem  *
     cbllink -d -rE -u%CompileOptions% -O%TLIB1%\%1.dll  %SLIB1%\%1.cbl
     if not "%ERRORLEVEL%" == "0" set Compile2DLLStatus=0010
     if not "%Compile2DLLStatus%" == "0000" goto :Compile2DLLNOK
rem  *
     if exist %TLIB1%\%1.dll goto :Compile2DLLAOK
     set Compile2DLLStatus=0020
     goto :Compile2DLLNOK
rem  *
:Compile2DLLNOK
     set /A NOK_Count=%NOK_Count% + 1
     set JobStatus=%Compile2DLLStatus%
     call SimoNOTE "ABENDING JobStep Compile Step, Status is %Compile2DLLStatus%, Program is %1"
     goto :End
rem  *
:Compile2DLLAOK
     if %TransferDLL%==Y  (echo Transfer DLL is ENABLED
                           COPY /Y %BaseLib1%\StagLib1\%1.DLL %BaseLib1%\ProdREC1\%1.DLL)
     if %EraseAfter%==Y   (echo Erase After is ENABLED
                           ERASE %BaseLib1%\StagLib1\%1.DLL)
     if %EraseOBJ%==Y     (echo Erase Object is ENABLED
                           ERASE %BaseLib1%\Adm1\%1.OBJ)
     set /A AOK_Count=%AOK_Count% + 1
     call SimoNOTE "Complete JobStep Compile Step, Status is %Compile2DLLStatus%, Program is %1"
     goto :End
rem  *
     call SimoNOTE "Produced LogFile %SYSLOG%"
     if "%JobStatus%" == "0000" goto :EOJAOK
     goto :EOJNOK
rem  *
rem  * *******************************************************************
:EOJAOK
     call SimoNOTE "Finished JobName zCompileModsDLLs01.CMD"
     goto :End
rem  *
rem  * *******************************************************************
:EOJNOK
     call SimoNOTE "ABENDING JobName zCompileModsDLLs01.CMD"
     goto :End
rem  * *******************************************************************
:End
     echo CobCpy is %CobCpy%


Table of Contents Previous Section Next Section Compile the Java Programs

The process for compiling the Java programs uses two command files and a list of java source members. The primary command reads the list file and for each record in the list file a call is made to the secondary command to do the Java compile.

Table of Contents Previous Section Next Section Primary Command for Java Compile

The following (JVBLDLW1.cmd) is the primary Windows Command File for the Java compile. This command uses a Windows "FOR" command to read a list file of java source member names and does a call to a secondary command to do a Java Compile for each member in the list.

@echo off
rem  * *******************************************************************
rem  *               JVBLDLW1.cmd - a Windows Command File               *
rem  *         This program is provided by SimoTime Enterprises          *
rem  *           (C) Copyright 1987-2014 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  * Text   - Primary Windows Command File for a Java compile process.
rem  * Author - SimoTime Enterprises
rem  * Date   - January 24, 1999
rem  *
rem  ****************************************************************
rem  * This is the primary Windows Command File for the Java compile.
rem  * This command uses a Windows "FOR" command to read a list file
rem  * and call the second command to do a Java Compile.
rem  ****************************************************************
rem  *
     call ..\ENV1BASE
     set JobStatus=0000
     set JobName=JVBLDLW1
rem  *
     call SimoNOTE "*******************************************************%JobName%"
     call SIMONOTE "* Starting %JobName% for Java Compiles..."
     set CLASSPATH=%CLASSPATH%;%BASELIB1%\JAVA
rem  *
     set SIMOMODE=BATCH
     set MemberList=JAVAMBRS_AP03.txt
     call SIMONOTE "* JVBLDLW1 MIFOSYS1 is ....... %MIFOSYS1% "
     call SIMONOTE "* JVBLDLW1 Member List is .... %MEMBERLIST% "
     call SIMONOTE "* JVBLDLW1 JAVABASE is ........ %JAVABASE% "
     call SIMONOTE "* JVBLDLW1 CLASSPATH is ...... %CLASSPATH% "
     for /F "eol=; tokens=1,2* delims=." %%i in (%MemberList%) do call JVBLDLW7 %%i
     if "%JobStatus%" == "0000" call SIMONOTE "* Finished  %JobName% for Java Compiles, Job Status is %JobStatus%"
     if not "%JobStatus%" == "0000" call SIMONOTE "* ABENDING  %JobName% for Java Compiles, Job Status is %JobStatus%"
     set SIMOMODE=
     pause
:END

Table of Contents Previous Section Next Section Secondary Command for Java Compile

The following (JVBLDLW8.cmd) is the secondary Windows Command File for the Java compile. This command will execute the "javac" program to compile a single java program based on the source member name specified as the first parameter.

@echo off
rem  * *******************************************************************
rem  *               JVBLDLW8.cmd - a Windows Command File               *
rem  *         This program is provided by SimoTime Enterprises          *
rem  *           (C) Copyright 1987-2014 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  * Text   - Secondary Windows Command File for a Java compile process.
rem  * Author - SimoTime Enterprises
rem  * Date   - January 24, 1999
rem  *
rem  ****************************************************************
rem  * This command will execute the "javac" program to compile a
rem  * single java program based on the source member name provide
rem  * by parameter one.
rem  ****************************************************************
rem  *
     call SimoNOTE "* --------------------------------------------------- *JVBLDLW8"
     call SIMONOTE "* Starting Compile for %1"
     if exist %1.class erase %1.class
     %JAVASDK%\javac %1.java -Xlint
     if exist %1.class call SIMONOTE "* Finished Compile for %1"
     if exist %1.class goto :END
     set JobStatus=0016
     call SIMONOTE "* ABENDING Compile for %1"
:END

Table of Contents Previous Section Next Section Start the Apache Tomcat Web Server

The following (SYS1TCOPEN.cmd) is the Windows Command File used to start the Apache Web Server.

@echo OFF
rem  * *******************************************************************
rem  *              SYS1TCOPEN.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   - Start Apache/Tomcat Server.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * This user-defined job script will set the necessary environment
rem  * variables and start the Apache Tomcat Server.
rem  *
rem  * Ths script will make calls to 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  *
rem  * *******************************************************************
rem  * Step 1, Set the Environment...
rem  *
     set CmdName=SYS1TCOPEN
     call ..\..\ENV1BASE %CmdName%
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
     set JobStatus=0000
rem  *
     call SIMONOTE "*******************************************************%CmdName%"
     call SIMONOTE "Starting CmdName %CmdName% - Start Apache/Tomcat Server"
rem  *
rem  * *******************************************************************
rem  * Step 2, Start Apache/Tomcat Server...
rem  *
     call SIMONOTE "CLASSPATH ........ %CLASSPATH%"
     call SIMONOTE "CATALINA_HOME .... %CATALINA_HOME%"
     call SIMONOTE "JRE_HOME ......... %JRE_HOME%"
     call SIMONOTE "Bulletin Startup Tomcat"
rem  *
     set PATHPCFCOMP=%BASELIB1%\SIMOGENS\COMPARES\
rem  * The following call statement will startup the Apache/Tomcat Server
     call %CATALINA_HOME%\bin\startup
rem  * The preceding call statement will startup the Apache/Tomcat Server
     if not ERRORLEVEL = 0 set JobStatus=0010
     if not %JobStatus% == 0000 goto :EojNok
:EojAok
     call SIMONOTE "Finished JobName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNok
     call SIMONOTE "ABENDING JobName %CmdName%, Job Status is %JobStatus%"
:End
     if not "%1" == "nopause" pause

Table of Contents Previous Section Next Section Shutdown the Apache Tomcat Web Server

The following (SYS1TCSHUT.cmd) is the Windows Command File used to start the Apache Web Server.

@echo OFF
rem  * *******************************************************************
rem  *             SYS1TCSHUT.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   - Shutdown Apache/Tomcat Server.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * This user-defined job script will set the necessary environment
rem  * variables and shutdown the Apache Tomcat Server.
rem  *
rem  * Ths script will make calls to 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  *
rem  * *******************************************************************
rem  * Step 1, Set the Environment...
rem  *
     set CmdName=SYS1TCSHUT
     call ..\..\ENV1BASE %CmdName%
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
     set JobStatus=0000
rem  *
     call SIMONOTE "*******************************************************%CmdName%"
     call SIMONOTE "Starting Job Name is %CmdName% - Shutdown Tomcat Server"
rem  *
rem  * *******************************************************************
rem  * Step 2, Shutdown Apache/Tomcat Server...
rem  *
     call SIMONOTE "Bulletin Shutdown Tomcat"
rem  * The following call statement will shutdown the Apache/Tomcat Server
     call %CATALINA_HOME%\bin\shutdown
rem  * The preceding call statement will shutdown the Apache/Tomcat Server
     if not ERRORLEVEL = 0 set JobStatus=0010
     if not %JobStatus% == 0000 goto :EojNok
:EojAok
     call SIMONOTE "Finished Job Name is %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNok
     call SIMONOTE "ABENDING Job Name is %CmdName%, Job Status is %JobStatus%"
:End
     if not "%1" == "nopause" pause

Table of Contents Previous Section Next Section Application Structure and Design

When creating a user desktop environment that includes the mainframe as a shared component some of the key items to consider are as follows.

The following is an overview of the SimoTime "COBOL and Java" Application.

           
browser
http://localhost:8080/menuj001.htm
   
menuj001
htm
   
   
Main Menu, HTML Document
   
   
ap01j001
jsp
An example of a data base (VSAM) inquiry program
   
   
   
ap02j001
jsp
Show how to capture information from a web page and write to a journal file
   
   
   
ap03j001
jsp
Use COBOL to convert a numeric currency value to a text string
   
   
   
ap04j001
jsp
Use COBOL to validate gregorian date format and provide results
   
   
   
ap05j001
jsp
Uses a COBOL program to calculate the difference between two dates
   
   
   
ap06j001
jsp
Uses a COBOL program to do a Hex-Dump of a data item
   
   
   
Apache
Web Site Link
A link to the SimoTime Web Site
   
   
   
Micro Focus
Web Site Link
A link to the SimoTime Web Site
   
   
   
Oracle Sun Java
Web Site Link
A link to the SimoTime Web Site
   
   
   
SimoTime
Web Site Link
A link to the SimoTime Web Site
 
Menu Program for the Java and COBOL Project

Table of Contents Previous Section Next Section Customer Inquiry

This section describes the infrastructure of the "Customer Inquiry" option that does a simple inquiry into a data base using a customer number. The local Data Base contains twenty-six (26) records. The Customer numbers are six digits. Valid customer numbers are 00nn00 where nn is 01-26.

The Data Base is a VSAM, Keyed-Sequential-Data-Set (KSDS). The format is EBCDIC. The COBOL program (AP01CUST.cbl) does the translation between EBCDIC and ASCII prior to returning to the calling program.

When the user does a click-on the  Help  button a link is made via a separate window to the "Customer Inquiry" section of this document (docsj001.htm).

Refer to the Run Sample Application, Customer Inquiry section of this document to use the application.

The following is an overview of the Customer Inquiry function

               
ap01j001
jsp
   
   
Java Server Page
   
   
ap01jc01
java
Java Bean
   
ap01jc02
java
   
   
Java scriplet that calls COBOL
   
   
   
ap01inq1
cobol
Convert between ASCII and EBCDIC
   
   
   
ap01inq2
cobol
Access a VSAM data set
   
   
   
QKSD0080
vsam, ksds
An EBCDIC-encoded, VSAM Keyed Sequential Data Set
   
ap01jc03
java
Java scriplet to format data to COBOL strings
 
Customer Inquiry, Structure and Design

Table of Contents Previous Section Next Section Customer Registration

This section describes the infrastructure of the "Customer Registration" option for saving information that has been typed by the user.

The Data Base is an ASCII/Text file. The format is ASCII. The COBOL program (AP02JRNL.cbl) does the writing to the file.

When the user does a click-on the  Help  button a link is made via a separate window to the "Customer Registration" section of this document (docsj001.htm).

Refer to the Run Sample Application, Customer Registration section of this document to use the application.

The following is an overview of the Customer Inquiry function

               
ap02j001
jsp
   
   
Java Server Page
   
   
ap02jc01
java
Java Bean
   
ap02jc02
java
   
   
Java scriplet that calls COBOL
   
   
   
ap02jrnl
cobol
Write to the journal file
   
   
   
SYSJRNL
ascii/text
An ASCII/Text file
   
ap02jc03
java
Java scriplet to format data to COBOL strings
 
Customer Registration, Structure and Design

Table of Contents Previous Section Next Section Write Me a Check

This section describes the infrastructure of the "Write Me a Check" option that displays a check image. The ap03j001.jsp will prompt the user for a name and an amount. The amount will be subjected to programmatic testing for reasonability. If reasonable the COBOL program (SIMOTXTN.cbl) will create a left-justified numeric, left-justified amount string and a verbal text string to be used when producing the check image.

The COBOL program (SIMOTXTN.cbl) does the creation of a text string from the numeric currency value provided.

When the user does a click-on the  Help  button a link is made via a separate window to the "Write Me a Check" section of this document (docsj001.htm).

Refer to the Run the Sample Application, Write Me a Check section of this document to use the application.

The following is an overview of the "Write Me a Check" function.

               
ap03j001
jsp
   
   
Java Server Page
   
   
ap03jc01
java
Java Bean
   
ap03jc02
java
   
   
Java scriplet that calls COBOL
   
   
   
simotxtn
cobol
Create a text string from a numeric value
   
ap03jc03
java
Java scriplet to format data to COBOL strings
 
Write Me a Check, Structure and Design

Table of Contents Previous Section Next Section Show Me the Date

This section describes the infrastructure of the "Show Me the Date" function. This example will prompt a user for a date in the ccyymmdd format. The user types a date and clicks on the Vali-DATE button. The user date will then be processed by the date validation and editing routine. If the user date is valid (i.e. meets the reasonability checks) the various date formats are displayed. Otherwise, an error message will be displayed.

When the user does a click-on the  Help  button a link is made via a separate window to the "Show Me the Date" section of this document (docsj001.htm).

Refer to the Run the Sample Application, Show Me the Date section of this document to use the application.

The following is an overview of the "Show me the Date" function.

               
ap04j001
jsp
   
   
Java Server Page
   
   
ap04jc01
java
Java Bean
   
ap04jc02
java
   
   
Java scriplet that calls COBOL
   
   
   
simodate
cobol
Validate, create and format various date fields
   
ap04jc03
java
Java scriplet to format data to COBOL strings
 
Show Me the Date, Structure and Design

Table of Contents Previous Section Next Section What is My Age

This section describes the infrastructure of the "What is My Age" function. This function shows how to calculate the difference in days between two dates.

A COBOL program (AP05DIFF.cbl) does the calculation of the difference. This program also calls another COBOL program (SIMODATE.cbl) to convert the Gregorian format to a Julian format that is used in the difference calculation.

When the user does a click-on the  Help  button a link is made via a separate window to the "What is my Age" section of this document (docsj001.htm).

Refer to the Run the Sample Application, What is My Age section of this document to use the application.

The following is an overview of the "What is my Age" function.

               
ap05j001
jsp
   
   
Java Server Page
   
   
ap05jc01
java
Java Bean
   
ap05jc02
java
   
   
Java scriplet that calls COBOL
   
   
   
simodiff
cobol
Calculate the number of days between birth date and today's date
   
   
   
simodate
cobol
Edit Gregorian date and provide julian date
   
ap05jc03
java
Java scriplet to format data to COBOL strings
 
What is My Age, Structure and Design

Table of Contents Previous Section Next Section Show Me the Hexadecimal Dump

This section describes the infrastructure of the "Hexadecimal Dump" function. This function will prompt the user for a thirty-two (32) character string and then display the hex-dump translation of the text string at the server console. The hex-dump information will also be written to the SYSLOG file.

When the user does a click-on the  Help  button a link is made via a separate window to the "Show Me the Hexadecimal Dump" section of this document (docsj001.htm).

Refer to the Run the Sample Application, Show Me the Hexadecimal Dump section of this document to use the application.

The following is an overview of the "Show Me the Hexadecimal Dump" function.

               
ap06j001
jsp
   
   
Java Server Page
   
   
ap06jc01
java
Java Bean
   
ap06jc02
java
   
   
Java scriplet that calls COBOL
   
   
   
simodump
cobol
Create and display a Hexadecimal Dump string
   
   
   
simologs
cobol
Write to the SYSLOG file
   
   
   
SYSLOG
ascii/Text
The SYSLOG File
   
ap06jc03
java
Java scriplet to format data to COBOL strings
 
Show Me the Hexadecimal Dump, Structure and Design

Table of Contents Previous Section Next Section Possibilities & Limitations

When moving an application or part of an application from a legacy environment to an application server a number of challenges will need to be addressed. This section briefly identifies some of the challenges and possible resolutions.

Table of Contents Previous Section Next Section ASCII and EBCDIC Translation

The "Customer Inquiry" function accesses a data base that is in EBCDIC format. This was done intentionally in order to determine how and when to do the ASCII and EBCDIC translation. It was decided to do the translation in the COBOL program since it could be easily accomplished with two tables and a single INSPECT statement.

Table of Contents Previous Section Next Section Expanded Help Text

Providing access to business functions by individuals outside a company may require a much higher level of usability than many legacy systems provide. It should not be assumed that what can be accomplished within a company by a skilled employee can be easily mastered by a first time user that is not familiar with the application. A higher degree of "user-friendly-ness" may be required. Improved messages will be needed when an individual does not follow the business rules. Readily available help text will be a requirement when moving to a Browser-Based interface.

Table of Contents Previous Section Next Section Numeric Fields

Text fields are simply converted between EBCDIC and ASCII depending on the direction of information flow. Packed fields may be left unchanged or in some cases will need to be unpacked. Binary fields may need to be inversed or expanded. Floating point values are processed on an IBM mainframe using mainframe format. The PC uses the IEEE format for floating point values. Sorting results in different sequencing for EBCDIC and ASCII files containing the same information. Unique requirements of the programming language being used on the application server or client machines need to be considered. For example, some PC COBOL compilers allow for binary fields of various lengths. The mainframe works with binary lengths of 2, 4, 8 or 16 bytes.

Table of Contents Previous Section Next Section Alpha-Numeric Fields, Truncate Spaces

Java has variable-length strings and COBOL has pre-defined, fixed-length fields. When returning information from COBOL back to Java it is more efficient to remove the trailing spaces. Also, if these trailing spaces are left in the Java string the user will not be able to easily make changes in insert-mode without first highlighting the spaces and then manually deleting the spaces.

Java provides a method for easily removing the trailing spaces. The following is an example of the use of the trim() method.

    public String getCustomerName()
    {
      return this.customerName.trim();
    }

Table of Contents Previous Section Next Section Summary

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

Table of Contents Previous Section Next Section Software Agreement and Disclaimer

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

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

Table of Contents Previous Section Next Section Downloads and Links

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

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

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

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

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

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

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

Link to Internet   Link to Server   Explore the Java Connection for examples of the various coding or programming techniques using the Java Software Development Kit from Oracle/Sun.

Link to Internet   Link to Server   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.

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

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

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connection.

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

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

Table of Contents Previous Section Next Section Glossary of Terms

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

Table of Contents Previous Section Next Section Comments or Feedback

This document was created and is copyrighted and maintained by SimoTime Technologies.

If you have any questions, suggestions, comments or feedback please call at 1 415 827-7045 or send an e-mail to: helpdesk@simotime.com

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
Java and COBOL, the Best of Both Worlds
Copyright © 1987-2019
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com