Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

some pictures...

Status
Not open for further replies.

Crox

Programmer
Apr 3, 2000
892
NL
Ever played with pictures? Looking for extreme results? Below an example. Try to know without testing/compiling what to expect. Just for fun.


000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. PTEST.
000300 ENVIRONMENT DIVISION.
000400 CONFIGURATION SECTION.
000500 SOURCE-COMPUTER. IBM-PC.
000600 OBJECT-COMPUTER. IBM-PC.
000700 SPECIAL-NAMES.
000800 CONSOLE IS CONSOLE
000900 DECIMAL-POINT IS COMMA.
001000 INPUT-OUTPUT SECTION.
001100 FILE-CONTROL.
001200 DATA DIVISION.
001300 WORKING-STORAGE SECTION.
001400 01 1-0 PIC X.
001500 01 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 PIC P(7)9.
001600 01 1-1-1-1-1-1-1-1-1-1-1-1-1-1-1
001700 REDEFINES 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
001800 PIC 9P(7).
001900 01 RED-0-0 REDEFINES 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0
002000 PIC X.
002100 01 999999999V999999999 PIC ZZZ.ZZZ.ZZZ,ZZZ.ZZZ.ZZZ.
002200 REPLACE OFF.
002300 PROCEDURE DIVISION.
002400 0001.
002500 MOVE '1' TO RED-0-0.
002600 EXHIBIT NAMED 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0.
002700 MOVE 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 TO 999999999V999999999.
002800 EXHIBIT NAMED 999999999V999999999.
002900 EXHIBIT NAMED 1-1-1-1-1-1-1-1-1-1-1-1-1-1-1.
003000 MOVE 1-1-1-1-1-1-1-1-1-1-1-1-1-1-1 TO 999999999V999999999.
003100 EXHIBIT NAMED 999999999V999999999.
003200
003300 MOVE 123456789,987654321 TO 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0.
003400 EXHIBIT NAMED 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0.
003500 MOVE 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 TO 999999999V999999999.
003600 EXHIBIT NAMED 999999999V999999999.
003700 EXHIBIT NAMED 1-1-1-1-1-1-1-1-1-1-1-1-1-1-1.
003800 MOVE 1-1-1-1-1-1-1-1-1-1-1-1-1-1-1 TO 999999999V999999999.
003900 EXHIBIT NAMED 999999999V999999999.
004000 9999.
004100 STOP RUN.

 
Our COBOL society seems sleeping, so I answer with the results..... 😂

0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 = 1
999999999V999999999 = ,000.000.010
1-1-1-1-1-1-1-1-1-1-1-1-1-1-1 = 1
999999999V999999999 = 10.000.000,000.000.000
0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 = 2
999999999V999999999 = ,000.000.020
1-1-1-1-1-1-1-1-1-1-1-1-1-1-1 = 2
999999999V999999999 = 20.000.000,000.000.000
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top