Ok I'm trying to add the after advancing constant in the write command to double space my output. Here are all the write commands in the code:
how do I add double spacing to my output?
I tried the following:
Didn't doublespace anything? Why?
My full source is:
Code:
WRITE PRINT-LINE FROM OUT-REC AFTER 2
WRITE PRINT-LINE FROM HEADING1 AFTER TOP-PAGE.
WRITE PRINT-LINE FROM HEADING2 AFTER 2.
how do I add double spacing to my output?
I tried the following:
Code:
WRITE PRINT-LINE FROM OUT-REC AFTER ADVANCING 2.
WRITE PRINT-LINE FROM HEADING1 AFTER ADVANCING TOP-PAGE.
WRITE PRINT-LINE FROM HEADING2 AFTER ADCANCING 2.
Didn't doublespace anything? Why?
My full source is:
Code:
IDENTIFICATION DIVISION.
PROGRAM-ID. PROJECT1.
AUTHOR. STEVEN.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-370.
OBJECT-COMPUTER. IBM-370.
SPECIAL-NAMES. C01 IS TOP-PAGE.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SONG-FILE ASSIGN TO UT-S-SYSIN.
SELECT PRINT-FILE ASSIGN TO UT-S-SYSOUT.
DATA DIVISION.
FILE SECTION.
FD SONG-FILE
LABEL RECORDS ARE OMITTED
RECORD CONTAINS 80 CHARACTERS
DATA RECORD IS SONG-IN.
01 SONG-IN.
05 SONG-TITLE PIC X(35).
05 SONG-ARTIST PIC X(30).
05 SONG-LABEL PIC X(11).
05 SONG-YEAR PIC X(4).
FD PRINT-FILE
LABEL RECORDS ARE OMITTED
RECORD CONTAINS 133 CHARACTERS
DATA RECORD IS PRINT-LINE.
01 PRINT-LINE PIC X(133).
WORKING-STORAGE SECTION.
01 EOF PIC 9 VALUE ZERO.
01 LINE-COUNT PIC 9(2) VALUE ZERO.
01 PAGE-NUM PIC 9(2) VALUE 1.
*
01 HEADING1.
02 FILLER PIC X(8) VALUE SPACES.
02 FILLER PIC X(35) VALUE 'TITLE'.
02 FILLER PIC X(5) VALUE SPACES.
02 FILLER PIC X(36) VALUE 'ARTIST'.
02 FILLER PIC X(5) VALUE SPACES.
02 FILLER PIC X(8) VALUE 'LABEL'.
02 FILLER PIC X(11) VALUE SPACES.
02 FILLER PIC X(4) VALUE 'YEAR'.
02 FILLER PIC X(2) VALUE SPACES.
02 FILLER PIC X(4) VALUE 'PAGE'.
02 PG-NUM PIC 99 VALUE ZEROS.
02 FILLER PIC X(16) VALUE SPACES.
*
01 HEADING2.
02 FILLER PIC X(1) VALUE SPACES.
02 FILLER PIC X(133) VALUE ALL '-'.
*
01 OUT-REC.
02 FILLER PIC X(8) VALUE SPACES.
02 PRINT-TITLE PIC X(35) VALUE SPACES.
02 FILLER PIC X(4) VALUE SPACES.
02 PRINT-ARTIST PIC X(36) VALUE SPACES.
02 FILLER PIC X(6) VALUE SPACES.
02 PRINT-LABEL PIC X(15) VALUE SPACES.
02 FILLER PIC X(4) VALUE SPACES.
02 PRINT-YEAR PIC X(4) VALUE SPACES.
*
PROCEDURE DIVISION.
MAINLINE.
OPEN INPUT SONG-FILE
OUTPUT PRINT-FILE.
PERFORM HEADING-RTN.
READ SONG-FILE
AT END MOVE 1 TO EOF.
PERFORM PROCESS-RECORDS
UNTIL EOF = 1.
* PERFORM CLOSING-RTM.
CLOSE SONG-FILE
PRINT-FILE.
STOP RUN.
*
PROCESS-RECORDS.
MOVE SONG-TITLE TO PRINT-TITLE
MOVE SONG-ARTIST TO PRINT-ARTIST
MOVE SONG-LABEL TO PRINT-LABEL
MOVE SONG-YEAR TO PRINT-YEAR
MOVE SPACES TO PRINT-LINE
WRITE PRINT-LINE FROM OUT-REC AFTER 2
ADD 1 TO LINE-COUNT.
*
*
READ SONG-FILE
AT END MOVE 1 TO EOF.
*
HEADING-RTN.
MOVE PAGE-NUM TO PG-NUM.
WRITE PRINT-LINE FROM HEADING1 AFTER TOP-PAGE.
WRITE PRINT-LINE FROM HEADING2 AFTER 2.
ADD 1 TO PAGE-NUM.
MOVE ZERO TO LINE-COUNT.
*CLOSING-RTM. WRITE PRINT-LINE FROM HEADING2.