Cobol Ch4

Home > Preview

The flashcards below were created by user slc53 on FreezingBlue Flashcards.


  1. Environment Division
    • ENVIRONMENT DIVISION.
    • INPUT-OUTPUT SECTION.
    • FILE-CONTROL.
    • SELECT F01-STUDENT-FILE ASSIGN TO ‘SENIOR.DAT'
    •      ORGANIZATION IS LINE SEQUENTIAL.
    • SELECT F02-PRINT-FILE ASSIGN TO ‘SENIOR.OUT'
    •      ORGANIZATION IS LINE SEQUENTIAL.
  2. Data Division
    • DATA DIVISION.
    • FILE SECTION.
    • FD F01-STUDENT-FILE
    •     RECORD CONTAINS 43 CHARACTERS
    •     DATA RECORD IS F01-STUDENT-RECORD.
    • 01 F01-STUDENT-RECORD.
    •     05 F01-STU-NAMEPIC X(25).
    •     05 F01-STU-CREDITSPIC 9(3).
    •     05 F01-STU-MAJORPIC X(15).
  3. Level number
    • Level 01 represents the whole record.
    • Level 05 represents fields within the record.
    • Level 01 is called a group item,
    • level 05 is called an elementary item.
  4. group vs elementary pic clause
    Group items do not have a pic clause, elementary items do have one.
  5. if a movie costs $18.99 to buy, the number would be stored in the file as ___
    A picture clause of ____
    1899. A picture clause of 99V99 tells Cobol where to put the decimal place.
  6. Which are valid?
    05 W02-CREDITS1  PIC 999 VALUE 110.
    05 W02-MAJOR1 PIC X(11) VALUE 'ENGINEERING'
    05 W02-CREDITS2 PIC 999 VALUE '110'
    05 W02-MAJOR2 PIC X(11) VALUE 789
    05 W02-MAJOR3 PIC X(11) VALUE ENGINEERING
    • 05 W02-CREDITS1  PIC 999 VALUE 110.
    •    valid
    • 05 W02-MAJOR1 PIC X(11) VALUE 'ENGINEERING'.
    •    valid
    • 05 W02-CREDITS2 PIC 999 VALUE '110'.
    •    no
    • 05 W02-MAJOR2 PIC X(11) VALUE 789.
    •    no, '789' yes
    • 05 W02-MAJOR3 PIC X(11) VALUE ENGINEERING no
  7. data is 1234567890
    01 F01-SOME-RECORD.
       05 F01-FIELD-A PIC 9V99.
       05 F01-FIELD-B PIC 99V9.
       05 F01-FIELD-C PIC 9.
       05 F01-FIELD-D PIC V999.
    • A = 1.23
    • B = 45.6
    • C = 7
    • D = 0.890
  8. PIC 999V99 is a ________ data type.
    PIC 999.99 is a __________ data type.
    PIC 999V99 is a number data type. PIC 999.99 is a string data type.

Card Set Information

Author:
slc53
ID:
329645
Filename:
Cobol Ch4
Updated:
2017-03-20 15:55:45
Tags:
Cobol Ch4
Folders:

Description:
Cobol Ch4
Show Answers:

Home > Flashcards > Print Preview