>> Rodney Roberts IS & Education Professional Homepage   >> Programming Tutorials And Downloads

Science makes it known,
Engineering makes it work,
Art makes it beautiful.


Combining Fujitsu COBOL 3.0, PowerCOBOL 3.0, Silverfrost FTN95, and Numerical Recipes:
The Art of Scientific Computing1 - COBOL Files

COBOL Source Files, compiling options
Include file of Global External variables used by all COBOL programs.  Needed because PowerCOBOL only passes system data,
not program data, to sheets through the LINKAGE SECTION.  ISTATCOM.COB contains two records - ISTATISTICS-COMMON
for application data
COBOL Record Layout IC-POINT-ARRAY is a one dimensional array (or vector),

IC-POINT-ARRAY-REDEF is a two dimensional matrix. Both share the same memory location.

Therefore, IC-POINTS(11) and IC-POINT(2,1) refer to the
same element.

and STAT-SYSTEM-STATE for application state


COBOL 3.0 subprogram, compile options Convert Lowercase Letters to Upper Case, Dynamic Load, Subprogram.
These are also the default PowerCOBOL compiler options.
INVKSHT.COB subprogram compiler options
The main program displays the sheet STF95IO by calling INVKSHT, passing the sheet name.  INVKSHT calls
_POWEROPENSHEET in F5BBRUNS.DLL, passing sheet name and sheet .dll file name (including full file path).


COBOL 3.0 main program, compile options Do Not Convert Lower Case Letters to Upper Case (NOALPHAL),
Dynamic Load, Main Program.
Notice the difference in converting Lower Case letters to Upper Case.  This applies to variable and
function/subroutine/subprogram names; recommended option for calling non-COBOL programs.
STF95COB.COB main program compiler options
Download STF95COB.COB

STF95IO.win (and associated STF95IO.* files):
PowerCOBOL 3.0 sheet (COBOL Graphical User Interface) compiled with default options.

Calling the FORTRAN Subroutines
The FORTRAN subroutines are called from the COBOL main program STF95COB.  The parameter order is the same as in the FORTRAN subroutines (some languages "pop" the parameter list in reverse order).  As can be seen, except for the data point array, passing elemental items from the GLOBAL EXTERNAL ISTATISTICS-COMMON.  Notice that the array Group item IC-POINT-ARRAY, not the Elementary item IC-POINTS, is passed. COBOL Call Statement
COBOL Call Statement COBOL Call Statement

This one is relatively easy.  Run Programming-Staff, click on Tools, then WINLINK.  Browse for
INVKSHT.OBJ, Add it, make Type DLL, then click Link

This one is slightly more difficult.  Start WINLINK, Browse and Add STF95COB.OBJ.
Then Browse and Add the required .LIB files, (not .OBJ).
Linking main program with WINLINK
Need to link INVKSHT.LIB, f5bbruns.lib, sttstcs.lib, and salflibc.lib.
Notice we do not need to link STF95IO.DLL (PowerCOBOL sheet).
Using _POWEROPENSHEET to call sheet STF95IO makes it unneeded.
Linking main program with WINLINK
After clicking Link, WINLINK runs Microsoft Linker; when Microsoft Linker is finished, it presents its message below.
Microsoft Linker
Unless changes are made to ISTATCOM.COB or the FORTRAN subroutines' parameter list,
it is not required to recompile and re-link all units; just recompile and re-link the changed unit.

Run Time Environment
COBOL85.CBR is the Runtime Environment file, and is presented during STF95COB.EXE startup until environment file
variable @EnvSetWindow is set to UNUSE.  It is necessary to set the entry points in this file.
Runtime Environment Setup
To set the entry points, click Section Selection, then Entry Information.  Input the name of the subprogram
and its .dll, as shown.  It is not necessary to input COBOL and PowerCOBOL subprograms.   Nor is it
necessary to input subprograms called by the entry points.

1. Press, William H., Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling (1986). Numerical Recipes: The Art of Scientific Computing. New York:Press Syndicate of the University of Cambridge.
2. Since this web page initially put up, additional functionality has been added. Files available for download include additional functionality.
3. This is a later version of INVKSHT than available at
Combining Fujitsu COBOL 3.0, PowerCOBOL 3.0, and the USPS Address Matching System API; however,
the values of DLL-NAME and SHEET-NAME are hard-coded in both versions and therefore incompatible.

When doing a Google Search for "COBOL Numerical Recipes" you may find several references for Google Docs
with the same terms and even graphics used in my Fujitsu COBOL web pages.   THE Google Docs ARE NOT
  They may have links for downloadable executable files which may or may not contain malware,
adware, or other undesirable features.   Example web addresses are:

There may be others.

Exercise Caution

Any and all © copyrights, ™ trademarks, or other intellectual property (IP) mentioned here are the property of their respective owners.  No infringement is intended.
Screen capture done with Nestegg Software's Screen Capture 1.4.7.
Thumbnails made with IrfanView.

Please feel free to use my code; please give credit (same idea as Copyleft).

Page best viewed with Mozilla FireFox 3.6.13 (or higher), Google Chrome Version 40.0.2214.94 (or higher), Apple Safari 5.1.7, and Haiku WebPositive 1.1 - Internet Explorer may not display or link correctly. Avoid Smart Applications Speed Browser.

NOTE - Later versions of Fujitsu PowerCOBOL may be better equipped for calling FORTRAN subroutines.

Free web hosting provided by:
Award Space Web Hosting Free Web Hosting X10hosting Free Web Hosting. Cheap Web Hosting. , &  GigaRocket Web Hosting

>> Rodney Roberts IS & Education Professional Homepage   >> Programming Tutorials And Downloads