gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [open-cobol-list] Best online and text tutorials?


From: John Culleton
Subject: Re: [open-cobol-list] Best online and text tutorials?
Date: Fri, 8 Aug 2008 14:58:22 -0400
User-agent: KMail/1.9.9

On Friday 08 August 2008 01:11:29 pm Fast Primes wrote:
> What are the best online and/or textbooks on PC based cobol? Enough
> to quickly do a "Hello World" program under Ubuntu or Vista?
>
> Thanks.
>
> FP

In COBOL things are done hopefully correctly but never quickly. You 
want quick---use Basic. 
 
For your simple Hello World program an example will do. For more info 
there are books on COBOL. Most of them are old and/or expensive. Here 
is the Hello World program. It is my  own COBOL template, usable with 
either Tiny COBOL or Open-COBOL:
-----------------------------------------------------------------
000010 IDENTIFICATION DIVISION.
000020 PROGRAM-ID. TEMPLATE.
000030 AUTHOR. JOHN CULLETON.
000040 INSTALLATION. WEXFORDPRESS
000045            Eldersburg MD.
000047*SECURITY. Copyright 2006 John R. Culleton, Jr. 
000050*REMARKS.
000060*    THIS IS A TEMPLATE FOR OPEN COBOL AND HTCOBOL.  
000070 ENVIRONMENT DIVISION.
000080 
000090 CONFIGURATION SECTION.
000100 SOURCE-COMPUTER.  
000110      Linux.
000120 OBJECT-COMPUTER. 
000230      Linux.
000140 
000150 INPUT-OUTPUT SECTION.
000160 FILE-CONTROL.
000170     SELECT PRINTFILE ASSIGN TO PRINTER.
000180 DATA DIVISION.
000190
000200 FILE SECTION.
000210
000220 WORKING-STORAGE SECTION.
000230
000240 PROCEDURE DIVISION.
000250 001-MAIN-PROCEDURE.
000260     DISPLAY "Hello World!".
000270          STOP RUN.
--------------------------------------------------------
COBOL programs have divisions, which may contain sections, which 
contain paragraphs, which contain statements that more or less look 
like English sentences.  Think a formal office procedure or Naval 
memo circa 1958.  That was the model. 
 
All four divisions and certain sections and paragraphs are mandatory 
or effectively mandatory in every COBOL program whatever its purpose. 
My template includes all of these. In the first three divisions 
section names are drawn from a fixed subset for each division. In the 
PROCEDURE division you get to make up your own names, but there are 
naming conventions nevertheless. 

I am an old-fashioned COBOL programmer, with a set of habits dating 
back to 1968.  You will note that I use a fixed format, with columns 
1-6 used for an (optional) line number. Column 7 is used for special 
indicarors, principally an * which indicates a comment line.  Columns 
8-72 are the A margin, which contains the names of things. Columns 
12-72 are the B margin which contains other things. The fixed format 
makes a COBOL program a bit harder to write but IMO easier to read. 

My generation learned COBOL not from textbooks but from vendor manuals
and also a set of tutorials in the form of programmed texts called 
the "IBM green books" (they had green covers.)  Programming was an 
apprenticeship business back then. We learned from each other. Among 
COBOL books anything from Mike Murach & Associates is worth having if 
you work in a big COBOL shop. Among the rest  _Structured COBOL 
Programming_ by Stern & Stern is one I prefer. The price for even a 
used copy on Amazon is exhorbitant, but that is common in the world 
of textbooks.

To my knowledge no one has written a "for Dummies" (R) book about 
COBOL but one may appear any day now. 
 
-- 
John Culleton
Resources for every author and publisher:
http://wexfordpress.com/tex/shortlist.pdf
http://wexfordpress.com/tex/packagers.pdf
http://www.creativemindspress.com/newbiefaq.htm
http://www.gropenassoc.com/TopLevelPages/reference%20desk.htm


reply via email to

[Prev in Thread] Current Thread [Next in Thread]