1 / 12

Hope you had a relaxing and productive break

Hope you had a relaxing and productive break. We have six more weeks to go and a lot more tests to take. The START Statement Start Filename Key Relational Operator Invalid Key Statement Not Invalid Key Statement End-Start. Read Next Read Filename Next Record

aimee
Download Presentation

Hope you had a relaxing and productive break

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Hope you had a relaxing and productive break We have six more weeks to go and a lot more tests to take

  2. The START Statement • Start Filename Key Relational Operator • Invalid Key Statement • Not Invalid Key Statement • End-Start

  3. Read Next • Read Filename Next Record • At End Statement • End-Read • File Status (Select Filename File Status is WS-STATUS) • Refer to pages 484 - 485)

  4. CHAPTER 15SINGLE-LEVEL ARRAYS AND TABLES

  5. ANNUAL-SALES-DATA SALES (1) SALES (2) SALES (12) . . . The Table Concept 01 ANNUAL-SALES-DATA. 05 JAN-SALES PIC 9(6). 05 FEB-SALES PIC 9(6). 05 MAR-SALES PIC 9(6). 05 APR-SALES PIC 9(6). 05 MAY-SALES PIC 9(6). 05 JUN-SALES PIC 9(6). 05 JUL-SALES PIC 9(6). 05 AUG-SALES PIC 9(6). 05 SEP-SALES PIC 9(6). 05 OCT-SALES PIC 9(6). 05 NOV-SALES PIC 9(6). 05 DEC-SALES PIC 9(6). (a) Brute Force 01 ANNUAL-SALES-DATA. 05 SALES OCCURS 12 TIMES PIC 9(6). (b) OCCURS Clause (c) Storage Schematic

  6. The OCCURS clause is defined in the DATA DIVISION.A Subscript is used in the PROCEDURE DIVISION to access individual elements of the array. The subscript can be an integer or a data-name (example SUB).01 WORK-FIELDS. 05 SUB PIC 9(2).

  7. SALARY-DATA (2) SALARY-DATA (1) SALARY-DATA (3) SALARY (2) SALARY (1) SALARY (3) SAL-DATE (2) SAL-DATE (1) SAL-DATE (3) Figure 11.4 OCCURS Clause at the Group Level 05 SALARY-DATA OCCURS 3 TIMES. 10 SALARY PIC 9(6)V99. 10 SAL-DATE PIC 9(4). (a) COBOL Statements (b) Storage Schematic

  8. SALARY-DATA SALARY (1) SAL-DATE (1) SALARY (2) SAL-DATE (2) SALARY (3) SAL-DATE (3) OCCURS Clause at the Elementary Level 05 SALARY-DATA. 10 SALARY OCCURS 3 TIMES PIC 9(6)V99. 10 SAL-DATE OCCURS 3 TIMES PIC 9(4). (a) COBOL Statements (b) Storage Schematic

  9. Processing a Table MOVE ZERO TO ANNUAL-TOTAL.PERFORM INCREMENT-ANNUAL-TOTAL VARYING SALES-SUB FROM 1 BY 1 UNTIL SALES-SUB > 12.. . .INCREMENT-ANNUAL-TOTAL. ADD SALES (SALES-SUB) TO ANNUAL-TOTAL. (a) Performing a Paragraph MOVE ZERO TO ANNUAL-TOTAL.PERFORM VARYING SALES-SUB FROM 1 BY 1 UNTIL SALES-SUB > 12 ADD SALES (SALES-SUB) TO ANNUAL-TOTALEND-PERFORM. (b) In-line Perform

  10. Initializeidentifier-1 to FROM value Increment identifier-1 with BY value Perform procedure-1 or imperative- statement Evaluate condition=1 FALSE TRUE PERFORM VARYING (with TEST BEFORE)

  11. Relative Subscripting CURRENT SALARY EFFECTIVE DATE PERCENT INCREASE $46,000 09/93 15.0% $40,000 09/92 11.1% $36,000 09/91 12.5% $32,000 09/90 (a) Salary History PERFORM VARYING SUB FROM 1 BY 1 UNTIL SUB > 3 OR SALARY (SUB + 1) = 0 COMPUTE PCT-SALARY-INC (SUB) = 100 * ((SALARY (SUB) - SALARY (SUB+1)) / SALARY (SUB + 1) END-COMPUTEEND-PERFORM (b) Computation of Percent Salary Increase

More Related