file concepts n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
FILE CONCEPTS PowerPoint Presentation
Download Presentation
FILE CONCEPTS

Loading in 2 Seconds...

play fullscreen
1 / 22

FILE CONCEPTS - PowerPoint PPT Presentation


  • 118 Views
  • Uploaded on

FILE CONCEPTS. The data used by the program cannot reside in main memory as it is volatile hence kept as files in the external memory.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'FILE CONCEPTS' - fionnuala


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
file concepts
FILE CONCEPTS
  • The data used by the program cannot reside in main memory as it is volatile hence kept as files in the external memory.
  • A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is made up of Individual sets of data called records which in turn are made up of indivisible units of data called fields
  • Ex: Student file -the data corresponding to a single student is a record and the roll no., name, dob, mark are the fields.
  • Primary key: Field that uniquely identifies a record in file.
  • Secondary Key: The keys other than the primary key which has a unique value for each record are called secondary keys.
file concepts1
FILE CONCEPTS
  • The data, information and programs are stored in external medium as FILES –program files and data files.
  • BUFFER-Temporary memory while transfering files from external to internal storage.

THREE ALGORITHMIC INSTRUCTIONS TO MANIPULATE A FILE

LFN=Logical File Number, a reference number to be used in the solution.

  • Open LFN: It tells the computer that the data in the file called filename is to be used, starting at the first record.
  • Read LFN Record copies the next record into the internal memory or into a small holding memory called buffer memory.
  • Close LFN It tells the computer that the file will not be used anymore.
slide3

Flowchart Symbols

Start or stop

Process

Input or output

Decision

Flow line

Connector

Off-page connector

slide4

Flowchart Symbols

Process Module

counter

Automatic-counter loop

A

B

S

system flowcharts
SystemFlowcharts
  • A system flowchart indicates the flow of data throughout the entire system.
  • It includes where the data are coming from keyboard, disk drive, etc., the name of the program to be processed, and where the information is to go disk drive, tape drive, printer,etc.

MONITOR

KEYBOARD

DISK

DRIVE

PROGRAM

PRINTER

example of a systemflowchart
EXAMPLE OF A SYSTEMFLOWCHART

MASTER

FILE

PROCESSPROGRAM

NEW

FILE

REPORT

designing records
DESIGNING RECORDS

RECORD DATA DICTIONARY

FILENAME:MAILING LIST

designing records1
Designing Records

While designing a records , there are many items to consider such as the number of items and their order, data types, and lengths, and the total record length

1.The number of fields is the number of items you listed under the Item Description.

2.The order of the fields is determined by the order of importance of the data.

3.The name of the fields should correspond to the item descriptions of the data.

4.The data type of each field is determined by the requirements of the solution

5.The length of the field is largely determined by the number of characters in the field.

6.Records are normally stored in external memory in blocks or section of a specific length.

sequential access file applications
Sequential Access File Applications

Processing Sequential-Access Files

  • EOF
  • Primer Read
  • Designing Output records
  • Headings and Line Counters
algorithm and flowchart of control module for sales problem
Algorithm And Flowchart Of Control Module For Sales Problem

Control

Control Module

1.Process Init

2.While NOT EoF(1)

1.Process Calc

2.Process Print

3.Process Read

While End

3.Process Wrap-up

4.End

Init

While

Not EOF(1)

F

T

Calc

Print

Read

Wrap up

End

algorithm for init module
ALGORITHM FOR INIT MODULE

Init

1.Open 1, Sales file

2.Sales Total = 0

3.MaxLineCt = 60

4.PageNo = 1

5.Process Read

6.Process Report Headings

7.Exit.

flowchart for init module
FLOWCHART FOR INIT MODULE

Init

Open 1

Sales File

Sales Total=0

Max Line Ct

= 60

PageNo=1

Read

Report Headings

Exit

slide14

ALGORITHM AND FLOWCHART FOR READ MODULE

Read

1.Read Record

2.Exit

Read

Read

Record

Exit

slide15
Report Readings

1.Write Report Readings

2.Get Date from System

3.Write Date

4.Line Ct=6

5.Process Column Headings

6.Exit

ALGORITHM FOR REPORT HEADINGS MODULE

flowchart for report headings module
FLOWCHART FOR REPORT HEADINGS MODULE

Report Headings

Write

Report

Headings

Get

Date

Write

Date

LineCt=6

Column Headings

Exit

algorithm and flowchart for column headings module
ALGORITHM AND FLOWCHART FOR COLUMN HEADINGS MODULE

Column Headings

1.Write Column Headings

(including the space

before and after)

2.LineCt=LineCt+3

3.Exit.

Column Headings

Write

Column

Headings

LineCt=

LineCt+3

Exit

algorithm and flowchart for calc module
ALGORITHM AND FLOWCHART FOR CALC MODULE

CALC

1.SalesTotal=Sales Total +Sales

2.Exit

Calc

Sales Total=SalesTotal+Sales

EXit

algorithm and flowchart for print module
ALGORITHM AND FLOWCHART FOR PRINT MODULE

Print

If LineCt>=

MaxLineCt

PageBreak

Print

1.IF LineCt>=MaxLineCt

Then

Process Page Break

2.Write Record

Information

3.LineCt=LineCt+1

4.Exit

T

F

Write

RECORD Information

LineCt=

LineCt+1

Exit

algorithm and flowchart for pagebreak module
ALGORITHM AND FLOWCHART FOR PAGEBREAK MODULE

Page break

  • Page break
  • PageNo=PageNo+1
  • Write Page Headings
  • LineCt=3
  • Process Column headings
  • Exit

Eject page

PageNo=

PageNo+1

Write Page Headings

LineCt=3

Column Headings

Exit

algorithm and flowchart for wrap upmodule
ALGORITHM AND FLOWCHART FOR WRAP-UPMODULE

Wrap Up

1.Write Sales Total

2.Close 1

3.Print “Run Completed”

4.Exit

Wrap up

WRITE

Sales Total

Close 1

Print

“Run

Completed”

Exit

slide22
Control Breaks

Control breaks are used to give subtotals for a group of similar records

Multiple Control Breaks

Multiple Control Breaks involve subtotals on more than one field.

Error Handling

For data validation, finding errors in the data records.

Null Files

Another problem that arises when you are working with files is to how to deal with the empty file or null file.