Skip to content

Commit e0044b4

Browse files
Merge pull request #159 from klausmelcher/add-more-comments
Replacing images without comments, as suggested in Pull Request #140
2 parents 27af975 + a8d4e38 commit e0044b4

23 files changed

+10
-10
lines changed

COBOL Programming Course #1 - Getting Started/COBOL Programming Course #1 - Getting Started.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,7 +1861,7 @@ The relationships among all data to be used in a program is defined in the DATA
18611861

18621862
A structured level number hierarchic relationship is available to all DATA DIVISION sections. Figure 1. shows the level number hierarchic relationship with programmer chosen level numbers, variable names and PIC clauses in the File Section where “01 PRINT-REC” references the following “05”-level group of variables and the “01 ACCT-FIELDS” references the following “05"-level group of variables. Observe 05-level CLIENT-ADDR is further subdivided into several 10-level names. COBOL code referencing the name CLIENT-ADDR includes the 10-level names.
18631863

1864-
![](Images/image107.jpg)
1864+
![](Images/image107.png)
18651865

18661866
*Figure 1. Level number hierarchic relationship*
18671867

@@ -1873,7 +1873,7 @@ After a record is defined, it can be subdivided to provide more detailed data re
18731873

18741874
MOVE and COMPUTE reserved word statements alter the value of variable names. Each MOVE shown in Figure 2. results in a literal stored in a 77-level variable name. The COMPUTE statement, also shown in Figure 2. , stores the value of `HOURS * RATE` in `GROSS-PAY.` All three variable names are assigned a numeric value data type using PIC 9, which is necessary for the operation of the COMPUTE statement.
18751875

1876-
![](Images/image108.jpg)
1876+
![](Images/image108.png)
18771877

18781878
*Figure 2. MOVE and COMPUTE example*
18791879

@@ -2003,7 +2003,7 @@ The ENVIRONMENT DIVISION and DATA DIVISION describes the inputs and outputs used
20032003

20042004
The FILE-CONTROL paragraph associates each COBOL internal file name with an external dataset name. Within the FILE-CONTROL paragraph, the SELECT clause creates an internal file name and the ASSIGN clause creates an external dataset name. Figure 1. shows the PRINT-LINE internal file name associated with the PRTLINE external dataset name and the ACCT-REC internal file name associated with the ACCTREC external dataset name. Section titled Assign Clause further explains the SELECT ASSIGN TO relationship.
20052005

2006-
![](Images/image125.jpg)
2006+
![](Images/image125.png)
20072007

20082008
*Figure 1. FILE-CONTROL*
20092009

@@ -2013,7 +2013,7 @@ While SELECT gives a name to an internal file and ASSIGN gives a name to the ext
20132013

20142014
The COBOL reserved word 'FD' is used to give the COBOL compiler more information about internal file names in the FILE-SECTION. The code below the FD statement is the record layout. The record layout consists of level numbers, variable names, data types, and lengths as shown in Figure 2.
20152015

2016-
![](Images/image126.jpg)
2016+
![](Images/image126.png)
20172017

20182018
*Figure 2. FILE-SECTION*
20192019

@@ -2076,7 +2076,7 @@ During COBOL program runtime, SELECT ASSIGN TO a JCL DDNAME is mandatory. If th
20762076

20772077
COBOL inputs and outputs must be opened to connect the selected internal name to the assigned external name. Figure 4. opens the file name ACCT-REC as program input and file name PRINT-LINE as program output.
20782078

2079-
![](Images/image128.jpg)
2079+
![](Images/image128.png)
20802080

20812081
*Figure 4. OPEN-FILES*
20822082

@@ -2102,7 +2102,7 @@ When reading records, the program needs to first check for no records to be read
21022102

21032103
READ-NEXT-RECORD repeatedly executes READ-RECORD and WRITE-RECORD until a last record is encountered. When the last record is encountered, then CLOSE-STOP is executed stopping the program.
21042104

2105-
![](Images/image130.jpg)
2105+
![](Images/image130.png)
21062106

21072107
*Figure 6. Reading and writing records*
21082108

@@ -2815,7 +2815,7 @@ This section briefly reviews certain aspects of the ENVIRONMENT DIVISION for the
28152815

28162816
The "File handling" section covered the SELECT and respective ASSIGN programmer chosen names, whereas this chapter focuses on output. Figure 1. shows a coding example using PRINT-LINE as the programmer chosen COBOL internal file name for output.
28172817

2818-
![](Images/image141.jpg)
2818+
![](Images/image141.png)
28192819

28202820
*Figure 1. SELECT and ASSIGN*
28212821

@@ -2827,7 +2827,7 @@ The File Description (FD), previously described under the FILE-CONTROL paragraph
28272827

28282828
Observe the data name FILLER. While most data fields have unique names, FILLER is a COBOL reserved word data name, that is useful for output formatting. This is in part because FILLER allocates memory space without the need for a name. Also, FILLER allocated memory has a defined length in the output line and may contain spaces or any literal. Figure 2. shows multiple VALUE SPACES for FILLER. SPACES create white space between data-items in the output which is valuable in keeping the code readable. More specifically in Figure 2. FILLER PIC X(02) VALUE SPACES, represents the output line containing two spaces.
28292829

2830-
![](Images/image142.jpg)
2830+
![](Images/image142.png)
28312831

28322832
*Figure 2. FILLER*
28332833

@@ -2883,7 +2883,7 @@ Writing report or column headers requires a structured output layout designed by
28832883

28842884
HEADER-2 includes the year, month, day of the report together with FILLER area, creating blank spaces between the year, month, and day, as you can see in Figure 3. Figure 4. is an example of the data name layout used to store the values of CURRENT-DATE. The information COBOL provides in CURRENT-DATE is used to populate the output file in HEADER-2.
28852885

2886-
![](Images/image144.jpg)
2886+
![](Images/image144.png)
28872887

28882888
*Figure 4. CURRENT-DATE intrinsic function*
28892889

@@ -2892,7 +2892,7 @@ HEADER-2 includes the year, month, day of the report together with FILLER area,
28922892

28932893
Figures 1 through 4 are a designed data layout that includes a data line and report headers. Using the storage mapped by the data line and report headers, COBOL processing logic can write the headers followed by each data line. Figure 5. is an example of an execution logic resulting used to write the header layout structure in a COBOL program.
28942894

2895-
![](Images/image145.jpg)
2895+
![](Images/image145.png)
28962896

28972897
*Figure 5. Execution logic to write header layout structure*
28982898

Binary file not shown.
11.6 KB
Loading
Binary file not shown.
17.3 KB
Loading
Binary file not shown.
5.39 KB
Loading
Binary file not shown.
6.01 KB
Loading
Binary file not shown.

0 commit comments

Comments
 (0)