Sequential File Organization - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

Sequential File Organization

Description:

Title: Sequential File Organization Author: psu Last modified by: Tuk Created Date: 5/15/1999 7:33:43 AM Document presentation format: On-screen Show – PowerPoint PPT presentation

Number of Views:195
Avg rating:3.0/5.0
Slides: 28
Provided by: psu63
Category:

less

Transcript and Presenter's Notes

Title: Sequential File Organization


1
Sequential File Organization
  • ?????? ???????
  • ??????????????????????????
  • ?????????????? ????????????????????????

2
???????
  • ????????????????????????????????????
  • ???????????????????????????
  • ???????????????????????????
  • ???????????????????????????
  • ?????????????????????????????????
  • ????????????????????

3
????????????
  • ????????????????????????? ??????????????????
  • ??????????????????????????????????
  • ??????????????????????????????????????????????????
    ?
  • ??????????????????? Record 10 ?????????? Record
    1, 2, ..., 9
  • ?????????????????? ???????????????????????????????
    ???????
  • ????????????????? Tape , Disk

4
??????????????????
  • Order File ????????????????????? Record
    ???????????? Primary Key ???
  • ?????? Primary key ??? i ???????????? Primary
    key ??? j
  • Pile File ????????????????????????????????????????
    ?? ??????? Record ?????????????????????

5
????????????? ???????????????????
  • ?? 1 File ????????????????????????????? ????
    Transaction File ???????????????????? ???????????
    ????????????????? ???????????????????????????????
    1 Field ???????????????????????????????????
  • ???????????????? Record ????? ?????????????????
    ????????? ?????????? Record ?????????
    ????????????????? ???? ???? Record 50 ???????????
    Record 10

6
?????????????????
  • ????????? Record ?????????????????????????????????
    ????
  • ?????????????????????
  • Master File
  • Transaction File
  • Report File

7
??????????????????????????(Transaction File)
  • ??????????????? ??????????????????????????????????
    ????????
  • ??????????????????????????????
  • ??????????????????????????????????????????????????
  • ??????????????????????????????????????????????????
    ????????????? ???????????????????????????????????
    ???? ?????????????????

8
??????????????????????????
  • ???????????????
  • ????????????????? Key

Transaction File
Sorting process
Sorted Transaction File
9
????????????????????????????
  • ??????????????????????????????
  • ?????????????
  • ???????????????
  • ????????????????????????

10
??????????????????? (Data Entry Device)
  • key-to-card
  • key-to-tape
  • key-to-disk
  • keyboard
  • optical scanner
  • bar code reader
  • magnetic reader

11
??????????????????????
  • ?????????????????????????????????????????????
  • ????????????????????????? ??????????????????

12
??????????????????
  • ????????????????????????????????
  • ????? ???????? ????????
  • ???????????????
  • ??????
  • ?????????? 3 ????????
  • Header
  • Detail
  • Footer

13
??????????? Record ???????????
  • Record ???????????????????????????????????????????
    ???????????????????????????????????????
  • ??????????????????????????????????????????????????
    ?? ?????????????? ?????? Report generator
  • ???????????????????????
  • ???????????????????????????????????????? Record
    (Inquiry)

14
????????????????????
  • ?????????????? (Mater File) ?????????????????????
  • ??????????????????????????????? ???? ??????????
    ??????????
  • ??????????????????? Master File ??????????????
  • ??????????? Master File ?????????????? Batch
    Processing
  • ??????????? Transaction ???????? ???????? Master
    File

15
????????????????????? ?????????
  • ????????????????????????? Master File ????????
    Version ??????????????????? Recovery ??????
    ????????????????????????????????? ??????????????

16
??????????????????? ?????????????? ????????
?????????????? ??????????
  • 1. get-next-old-master( read eof)
  • 2. get-next-transactions( read eof)
  • 3. until end-of-old-master or end-of-transactions
    do
  • if trans-key gt old-master-key then
  • no trans
  • copy old-master-to-new-master
  • get-next-old-master
  • else
  • if trans-key old-master-key then
  • make change in master record
  • output master record to new master
  • get-next-old-master
  • get-next-transactions
  • else
  • if trans-key lt old-master-key then
  • display no record in master to update
  • get-next-transactions
  • endif
  • endif

17
??????????????????? ????????? ???????? lt
????????? ??????????
  • ?????? 3.7 1. get-next-old-master( read eof)
  • 2. get-next-transactions( read eof)
  • 3. until end-of-old-master or end-of-transactions
    do
  • if trans-key gt old-master-key then
  • no trans for update
  • get-next-old-master
  • else
  • if trans-key old-master-key then
  • make change in master record
  • get-next-transactions
  • else
  • if trans-key lt old-master-key then
  • display no record in master to update
  • get-next-transactions
  • endif
  • endif
  • endif
  • enduntil

18
?????? ???????????????????????????????????
  • ????????????????????????????
  • ??????????????
  • ?????????????????????????????????
  • File Activity Ratio Record ?????????? MF /
    Record ?? MF
  • ?????? ??????????????????????? Interactive
    ??????????????????????

19
????????????????????????????
  • ???????? Record ?????????????????????(Insert
    Record)
  • ????? Record ???????????????????(Delete Record)
  • ??????????????????????????????? Record (Update
    Record)

20
??????????????????????????????????
  • ????? Record ?????????????????
  • ?? Record ??????????????
  • ??????????? Record ??????????????

21
??????????????????
  • ??????? Record ?????????? ????????? (field)
    ????????
  • ????????? Record
  • Fixed Length record
  • Variable length record , Repeat group field
  • ?????????????????? Primary Key
  • Blocking Factor ?????????????????????????

22
??????? Record ??? Field
  • Activity Field
  • Inactivity Filed
  • Activity Record
  • Inactivity Record

23
?????????? Primary Key
  • ??????????????????????
  • ??????? Transaction File ??? field ???????? Mater
    File
  • ??????????????????????????? ??????????????????????
    ????????
  • ??????? Master File ????????? Unique
    ???????????????????????????????????????????
    Record ???

24
??????? Blocking Factor
  • Tape gt ??????? Blocking Factor
    ?????????????????????????????? ???????????????????
    ???? Buffer ?????????????
  • Disk gt ????????????????????????? Cluster
    (sector , Track) ??????????????????? Buffer
    ?????????????

25
??????????????????????
  • ???????????????????????
  • ???????????????????????????
  • ?????????????????? ???????????????????????????
  • ????????????????????????? ????????????????????????
    ?????????????
  • ???????????????????? ?????????????????????????????
    ?? ?????????????????????????????????????
  • ???????????????????????????? ?????????????????????
    ???????????????????? ???? ??????????????

26
????????????????????
  • ???????????????????????????????
  • ??????????????????????????????????????????????????
    ?????????? ???? inquiry ???? interactive
    transaction processing

27
????????????????????
  • IDENTIFICATION DIVISION
  • ENVIRONMENT DIVISION
  • SELECT OLD-MASTER ASSIGN TO TAPE.
  • FD OLD-MASTER
  • LABEL RECORDS ARE STANDARD
  • RECORD CONTAINS 100 CHARACTERS
  • BLOCK CONTAINS 20 RECORDS
  • DATA RECORD IS OLD-MASTER-REC.
  • ORGANIZATION IS SEQUENTIAL.
  • ACCESS MODE IS SEQUENTIAL.
  • 3. DATA DIVISION
  • 01 old-master-record.
  • 05 student-no picture 9(7).
  • 05 student-name picture A(30).
  • 05 student-address picture X(30).
  • 4. PROCEDURE DIVISION
Write a Comment
User Comments (0)
About PowerShow.com