Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
000400 IDENTIFICATION DIVISION.
000500 PROGRAM-ID. TEST0001.
000600* COPYRIGHT (C) Crox
000700 ENVIRONMENT DIVISION.
000800 CONFIGURATION SECTION.
000900 SOURCE-COMPUTER. IBM-PC.
001000 OBJECT-COMPUTER. IBM-PC.
001100 INPUT-OUTPUT SECTION.
001200 FILE-CONTROL.
001300 DATA DIVISION.
001400 FILE SECTION.
001500 WORKING-STORAGE SECTION.
001600 01 HULPVELDEN.
001700 03 X VALUE 9 PIC 9.
001800 03 Y VALUE 8 PIC 9.
001900 PROCEDURE DIVISION.
002000 HOOFD SECTION.
002100 0001.
002300 PERFORM HULP
002400 VARYING X FROM 1 BY 1 UNTIL X > 3
002500 AFTER Y FROM X BY 1 UNTIL Y > 3.
002600 0009.
002700 STOP RUN.
002800
002900 HULP SECTION.
003000 0001.
003100 DISPLAY 'X / Y: ' X ' / ' Y.
003200 0009.
003300 EXIT.
output os/vs cobol:
X / Y: 1 / 1
X / Y: 1 / 2
X / Y: 1 / 3
X / Y: 2 / 1
X / Y: 2 / 2
X / Y: 2 / 3
X / Y: 3 / 2
X / Y: 3 / 3
output cobol 390:
X / Y: 1 / 1
X / Y: 1 / 2
X / Y: 1 / 3
X / Y: 2 / 2
X / Y: 2 / 3
X / Y: 3 / 3
000400 IDENTIFICATION DIVISION.
000500 PROGRAM-ID. TEST0006.
000510* COPYRIGHT (C) Crox
000600 ENVIRONMENT DIVISION.
000700 CONFIGURATION SECTION.
000800 SOURCE-COMPUTER. IBM-PC.
000900 OBJECT-COMPUTER. IBM-PC.
001000 INPUT-OUTPUT SECTION.
001100 FILE-CONTROL.
001200 DATA DIVISION.
001300 FILE SECTION.
001400 WORKING-STORAGE SECTION.
001500 01 VARIABEL-RECORD-1.
001600 03 VR1-LENGTE PIC S9(4) COMP.
001700 03 VR1-DATA VALUE SPACE.
001800 05 VR1-DATA-TEKEN OCCURS 1 TO 5
001900 DEPENDING ON VR1-LENGTE PIC X.
002000
002100 01 VARIABEL-RECORD-2.
002200 03 VR2-LENGTE PIC S9(4) COMP VALUE +3.
002300 03 VR2-DATA VALUE '12345'.
002400 05 VR2-DATA-TEKEN OCCURS 1 TO 5
002500 DEPENDING ON VR2-LENGTE PIC X.
002600
002700 PROCEDURE DIVISION.
002800 HOOFD SECTION.
002900 0001.
003100 DISPLAY 'VR2-DATA : ' QUOTE VR2-DATA QUOTE.
003200 DISPLAY 'VR1-DATA : ' QUOTE VR1-DATA QUOTE.
003300 MOVE VARIABEL-RECORD-2 TO VARIABEL-RECORD-1.
003400 DISPLAY 'VR1-DATA NA 1E MOVE : ' QUOTE VR1-DATA QUOTE.
003500 MOVE VARIABEL-RECORD-2 TO VARIABEL-RECORD-1.
003600 DISPLAY 'VR1-DATA NA 2E MOVE : ' QUOTE VR1-DATA QUOTE.
003610 MOVE +5 TO VR1-LENGTE.
003611 DISPLAY 'VR1-DATA NA 2E MOVE : ' QUOTE VR1-DATA QUOTE.
003612 MOVE +5 TO VR2-LENGTE.
003613 DISPLAY 'VR2-DATA : ' QUOTE VR2-DATA QUOTE.
003700 0009.
003800 STOP RUN.
output COBOL 74:
VR2-DATA : '123'
VR1-DATA : ''
VR1-DATA NA 1E MOVE : ' '
VR1-DATA NA 2E MOVE : '123'
VR1-DATA NA 2E MOVE : '123 '
VR2-DATA : '12345'
output COBOL 85:
VR2-DATA : '123'
VR1-DATA : ''
VR1-DATA NA 1E MOVE : '123'
VR1-DATA NA 2E MOVE : '123'
VR1-DATA NA 2E MOVE : '123 '
VR2-DATA : '12345'