COBOL Examples by Source

>Micro Focus Acucobol Program Samples
This is a collection of COBOL program examples that help illustrate general programming techniques integral to developing with Acucobol. 

>AS/400, iSeries COBOL Programming Tips & Techniques
These are iSeries (AS/400) COBOL programming tips and techniques covering APIs, CGI COBOL, XML COBOL, and other COBOL code examples. 

>Bristol Community College, Priscilla Grocer
These sample programs cover COBOL language elements, two and three files matching, random and sequential files, bubble sort, relative files, screen processing, variable length records, working with dates, object oriented programs, and data structures. 

>C# Corner
Here you will find various COBOL .NET in C# related source code examples. 

>Capitalware
Several WebSphere MQ COBOL code samples and COBOL code samples for the Alchemy / Fujitsu COBOL compiler, including PowerCOBOL code samples, are provided. 

>COBOL Bible
These are notes that have been obtained from various sources on how to write the syntax of COBOL programs. 

>COBOL Center
Here are examples of date routines, free-form number routine, loan amount/payment, convert numeric dollars, edit and reverse name, and table sort. 

>COBOL8M
Here are examples of integrating operating system functions into MicroFocus Net Express. 

>Davar Web Site
Here are examples of how to output the current date and time as DB2 timestamp to a file and how to edit input of an unsigned integer number. 

>Eastern Kentucky University
This sample calculates employee payroll information given the tax deduction table for the employee. 

>Free Programming Resources
Here are links to free COBOL resources and COBOL code. 

>Alchemy Solutions / Fujitsu Software
This is a collection of sample programs using Alchemy / Fujitsu COBOL, NetCOBOL for Windows, and PowerCOBOL. 

>GUI Innovations
This example demonstrates TCP/IP server for the HPe3000 server. It contains a sample TCP/IP client, written in Visual Basic, and a sample TCP/IP server for the HPe3000 server written in COBOL. 

>HostBridge Technology
Here is a collection of examples that have been developed to make it easy for a COBOL CICS program to send an outbound TCP/IP request (and optionally wait for a response). These programs are available in both Assembler and COBOL and can be used without HostBridge. 

>IT Doctors
This is a sample of VS COBOL code.

>KernerlThread
This sample was developed with the Open COBOL compiler. The Towers of Hanoi as a COBOL program. 

>Lawrence Truett
This site contains examples that demonstrate various COBOL syntax. 

>http://support.microsoft.com:80/support/kb/articles/Q103/2/26.asp&NoWebContent=1" class="contentLink" target="_blank">Microsoft
This sample demonstrates a mixed-language (Microsoft Visual Basic, COBOL, and SQL) application that can be used to build full-featured client-server applications. 

>Murach
Here are downloads of the COBOL code of the programs in the Murach's Structured COBOL book. 

>Norcom
This Norcom sample program will display and handle user interaction with any type of GUI ScreenIO panel (including a property sheet or a wizard), regardless of the type or number of controls it contains. 

>Penn State Lehigh Valley
This program in COBOL sample is for beginner's. 

>SimoTime
This is a suite of samples that were written using the IBM VS COBOL II or Micro Focus Net Express COBOL, covering Java, bit manipulation, data access, and more. 

>Softech Solutions
This is an example of a COBOL II bubble sort. 

>Sun Valley Systems
Here are samples that demonstrate date routines, free-form extraction, loan amount calculation, money to text, validate/reverse name, and table sort. 

>Sybase
Here are COBOL SQL sample programs that demonstrate features such as how to code a batch of INSERT requests, how to code a DB2 input pipe, how to code a transfer request, how to code keyword input, how to embed SQL in COBOL programs, and more. 

>University of Limerick
This is an accumulation of examples for beginner's that demonstrate selection and iteration, sequential files, sorting and merging, direct access files, calling sub-programs, string handling, the COBOL report writer, and COBOL tables. 

>University of Michigan - Dearborn
This sample COBOL code for beginners presents a hello word program and accept_num program.

>VyomWorld.com
General COBOL programs are provided that include COBOL scripts and code snippets. 

>zingCOBOL
This sample COBOL code is for beginner's.

 

Client/Server Code Examples

>CGI Examples Using iSeries COBOL
Here are a couple of sample COBOL CGI programs for the iSeries COBOL community. This library offers a COBOL interface to the CGI service program. A COBOL CGI tutorial is included. 

>MPE/iX Enterprise Client - COBOL Example
This COBOL program example will select and join two DB2 tables located on a Windows 2000 server, extract a few fields and sort by PROJNO. The results will be displayed in the STDLIST. 

>MQSeries for MVS/ESA - Message Handler Sample
This example provides C and COBOL sample code for a message handling application for WebSphere MQ for z/OS. 

>TCP/IP Server
This is a COBOL sample Client/Server application to show the basic mechanics of TCP/IP protocol and the HPe3000. It contains a TCP/IP client, written in Visual Basic, and a sample TCP/IP server for the HPe3000 server written in COBOL.

>TCP/IP Sockets, MVS - Datagram Socket COBOL Server Program
Here you will find basic TCP/IP socket programming information for MVS COBOL program developers who plan to use the socket programming interfaces of IBM TCP/IP for MVS. 

>http://support.microsoft.com:80/support/kb/articles/Q103/2/26.asp&NoWebContent=1" class="contentLink" target="_blank">Visual Basic/COBOL/SQL Sample Application
The COBOL sample demonstrates a mixed-language (Microsoft Visual Basic, COBOL, and SQL) application that can be used to build full-featured client-server applications. 

>Web Services from NetCOBOL
This demonstrates the use of a Web Service with the client developed using NETCOBOL for .NET. 

>WebSphere MQ COBOL Code Samples
The sample COBOL programs demonstrate how to send a request message, wait for a reply message, process a request message, and send a reply message. Samples are included from the MQSeries toolkit.

 

 

File Handling Code Examples

>COBOL Coding for Files Example
The general format of COBOL input-output coding is shown. 

>COBOL File Status Code with Text Information
This COBOL file status example will show how to convert the two byte file status code that may contain binary data to a four byte numeric value that may be displayed. 

>COBOL File System and Programming
Here are COBOL file system and programming source code examples. 

>COBOL Record Format Examples
COBOL sample code describing record description, determining fixed-length record size, determining fixed-length record size for files with multiple record descriptions, creating variable-length records with the DEPENDING ON Phrase, creating variable-length records with the RECORD VARYING Phrase, and creating variable-length records and using the OCCURS Clause with the DEPENDING ON Phrase. 

>Comma delimited, QSAM, and COBOL VSAM Files
Here are several COBOL data access sample programs that cover handling comma delimited, QSAM, and COBOL VSAM files. 

>Displaying Record-Lock Messages
This iSeries COBOL subroutine displays record-lock messages. 

>EBCDIC to ASCII
This COBOL program converts EBCDIC-sequential to ASCII-indexed. 

>Line Sequential File Example
This COBOL sample demonstrates line sequential file handling. 

>Read an IFS File
This is an iSeries Cobol example showing how to read lines from an IFS file. 

>COBOL VSAM and QSAM COBOL File Status Keys/Error Codes
This is a COBOL program example of how to determine the COBOL VSAM and QSAM COBOL file status keys/error codes in an IBM Enterprise COBOL environment. 

>VSAM File Access for COBOL
If you are interested in writing COBOL programs that utilize VSAM datasets, I hope this documentation has provided you with the information you need to install my routine and get started writing programs on your own.

 

 

 

 

Database Code Examples

>ADO.NET/ COBOL/Stored Procedures
This COBOL sample provides an example of how to access a stored procedure to perform a specific task such as create a new table, retrieve data from one or more tables, update one or more tables or perform many other tasks. 

>COBOL Procedures
COBOL procedures are to be written in a similar manner as COBOL subprograms. This COBOL example describes handling parameters in a COBOL procedure and exiting a COBOL procedure.

>DB2 Explain Command
How to Explain a DB2 SQL Command for a single table. 

>DB2/SQL/COBOL Samples
Several IBM COBOL and MicroFocus COBOL samples that include COBOL DB2 API sample programs with no embedded SQL, COBOL DB2 API embedded SQL sample programs, and COBOL SQL sample programs with no DB2 APIs. 

>DB2/SQL/COBOL for AS/400 Example
The SQL COBOL example demonstrates how to code SQL statements using iSeries (AS400) COBOL. 

>Sybase COBOL SQL Samples
The COBOL sample programs demonstrate features such as how to code a batch of INSERT requests, how to code a DB2 Input Pipe, how to code a transfer request, how to code keyword input, how to embed SQL in COBOL programs, and more. 

>Tips for Writing an INMOD in COBOL
Here are tips for writing INMOD routines for Teradata FastLoad in COBOL

 

General COBOL Code Examples

>Micro Focus Acucobol Sample Programs
This is a collection of sample programs that help illustrate certain concepts integral to developing with ACUCOBOL-85 and ACUCOBOL-GT. 

>Bubble Sort in COBOL
This is an example of a COBOL II bubble sort. >COBOL Example Programs
This is a list of COBOL examples that demonstrate date routines, get free-form number routine, table sorts, and more. 

>COBOL Example Programs
These sample programs illustrate date routines, free-form extraction, loan amount calculation, money to text, validate/reverse name, and table sort. 

>COBOL Example for Beginner's
This example is for beginner's. 

>COBOL Programs for Beginner's
Here is a large number of examples for beginner's. 

>COBOL Programs for Beginner's
Here are sample COBOL programs that include hello word, accept number, and sales file processing. 

>COBOL Programs for Beginner's
This COBOL example calculates employee payroll information given the tax deduction table for the employee. 

>COBOL Programs for Beginner's
Here is collection of sample code for beginner's. 

>COBOL Reference, Syntax, and Examples
The COBOL samples here cover COBOL syntax for current-date function, evaluate statement, if and end-iIf statement, initialize statement, in-line perform, inspect statement, and reference modification 

>COBOL Sample Programs
These sample programs cover COBOL language elements, two and three files matching, random and sequential files, bubble sort, relative files, screen processing, variable length records, working with dates, object oriented programs, and data structures.

>Dateout COBOL II Procedure
This program outputs current date and time as DB2 timestamp to a file. 

>Editint COBOL Subroutine
This subroutine determines validity of input unsigned integer number and edits it in its place. 

>Fujitsu / Alchemy NetCOBOL Sample Programs
These samples were tested with Version 4 & 5 of the Fujitsu COBOL product set. 

>How to Write the Syntax of COBOL Programs
These are notes that have been obtained from various sources on how to write the syntax of COBOL programs. 

>HP COBOL II/XL Program Example
This example contains a complete COBOL program listing from the HP COBOL II/XL compiler. 

>General COBOL Sample Programs
This is a collection of COBOL examples that show sequential file program, balance sheet printing, calculating yearly depreciation, computing interest, and more 

>Micro Focus Sample Programs
Here are examples of integrating operating system functions into Micro Focus Net Express. 

>Source Entry Utility (SEU) Extensions
These examples show how to extend the functionality of SEU with your own line commands. 

>Structured COBOL
This is the source code from Murach's Structured COBOL book. 

>Towers of Hanoi
This program was developed with the Open COBOL compiler. 

>VS COBOL Code
This is a typical example of the type of COBOL programs in many mature installations.

 

This website uses cookies to manage authentication, navigation, and other functions. By using our website, you agree that we can place these types of cookies on your device.

View e-Privacy Directive Documents

You have declined cookies. This decision can be reversed.

You have allowed cookies to be placed on your computer. This decision can be reversed.

Login

Who's Online

Member Login