Skip to content

Commit 1b52ff4

Browse files
authored
Merge branch 'master' into COBOL-API
2 parents 4a8aee0 + 734bdf2 commit 1b52ff4

File tree

1 file changed

+14
-1
lines changed
  • COBOL Programming Course #1 - Getting Started/Labs/cbl

1 file changed

+14
-1
lines changed

COBOL Programming Course #1 - Getting Started/Labs/cbl/CBL0010.cobol

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,27 @@
3838
10 USA-STATE PIC X(15).
3939
05 RESERVED PIC X(7).
4040
05 COMMENTS PIC X(50).
41-
*
41+
* The USAGE Clause specifies the storage of a data item,
42+
* e.g USAGE IS COMP-3, or just COMP-3.
43+
* COMP-3 is the equivalent of packed-decimal, frequently used
44+
* rather than COMP-1(floating-point), COMP-2(long floating-point)
45+
* COMP-4(binary) and COMP-5(native binary).
46+
* When no value for USAGE Clause is specified, Default value is
47+
* DISPLAY. To do an arithmetic operation with a DISPLAY number,
48+
* the program must first convert the characters to a binary
49+
* number, execute the operation and convert it back,
50+
* which is less eficient than a computational data type.
51+
*
4252
WORKING-STORAGE SECTION.
4353
01 FLAGS.
4454
05 LASTREC PIC X VALUE SPACE.
4555
*
4656
01 TLIMIT-TBALANCE.
4757
05 TLIMIT PIC S9(9)V99 COMP-3 VALUE ZERO.
4858
05 TBALANCE PIC S9(9)V99 COMP-3 VALUE ZERO.
59+
* Hint: to know which character format is being used,
60+
* you can type HEX ON on the command line and compare to
61+
* a ASCII/EBCDIC Table. then HEX OFF to turn hex numbers off
4962
*
5063
01 HEADER-1.
5164
05 FILLER PIC X(20) VALUE 'Financial Report for'.

0 commit comments

Comments
 (0)