LAB3B - 01 SORTED-ZOO-RECORD PIC X(24). WORKING-STORAGE...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
IDENTIFICATION DIVISION. PROGRAM-ID. LAB3B INITIAL. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT ZOO-FILE ASSIGN TO DISK 'ZOO.DAT' ORGANIZATION IS LINE SEQUENTIAL. SELECT SORTWORK-FILE ASSIGN TO DISK 'TEMP'. SELECT SORTED-ZOO-FILE ASSIGN TO DISK 'ZOO.SRT' ORGANIZATION IS LINE SEQUENTIAL. DATA DIVISION. FILE SECTION. FD ZOO-FILE. 01 ZOO-RECORD. 05 I-ID PIC 9(6). 05 I-SPECIES PIC X(2). 05 I-TYPE PIC X(2). 05 I-GROUP PIC 9(2). 05 I-SEX PIC X. 05 I-QOH PIC 999. 05 I-VALUE PIC 9(6)V99. SD SORTWORK-FILE. 01 SORTWORK-RECORD. 05 SW-ID PIC 9(6). 05 SW-SPECIES PIC X(2). 05 SW-TYPE PIC X(2). 05 SW-GROUP PIC 9(2). 05 SW-SEX PIC X. 05 SW-QOH PIC 999. 05 SW-VALUE PIC 9(6)V99. FD SORTED-ZOO-FILE.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 01 SORTED-ZOO-RECORD PIC X(24). WORKING-STORAGE SECTION. 01 MISC. 05 EOF PIC X VALUE 'N'. PROCEDURE DIVISION. 000-MAIN-DRIVER. SORT SORTWORK-FILE ASCENDING KEY SW-SPECIES, SW-TYPE INPUT PROCEDURE IS IP GIVING SORTED-ZOO-FILE. GOBACK. IP SECTION. IP-000-MAIN. PERFORM IP-100-INITIAL. PERFORM IP-200-PROCESS UNTIL EOF = 'Y'. PERFORM IP-900-TERM. GO TO IP-EXIT. IP-100-INITIAL. OPEN INPUT ZOO-FILE PERFORM IP-700-READ. IP-200-PROCESS. IF I-GROUP = 10 RELEASE SORTWORK-RECORD FROM ZOO-RECORD END-IF PERFORM IP-700-READ. IP-700-READ. READ ZOO-FILE AT END MOVE 'Y' TO EOF END-READ. IP-900-TERM. CLOSE ZOO-FILE. IP-EXIT. EXIT....
View Full Document

This note was uploaded on 10/09/2011 for the course CIS 355 taught by Professor Champion during the Spring '11 term at DeVry Columbus North.

Page1 / 2

LAB3B - 01 SORTED-ZOO-RECORD PIC X(24). WORKING-STORAGE...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online