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.
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.
THREE ALGORITHMIC INSTRUCTIONS TO MANIPULATE A FILE
LFN=Logical File Number, a reference number to be used in the solution.
Start or stop
Input or output
RECORD DATA DICTIONARY
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.
Processing Sequential-Access Files
2.While NOT EoF(1)
1.Open 1, Sales file
2.Sales Total = 0
3.MaxLineCt = 60
4.PageNo = 1
6.Process Report Headings
Max Line Ct
1.Write Report Readings
2.Get Date from System
5.Process Column Headings
ALGORITHM FOR REPORT HEADINGS MODULE
1.Write Column Headings
(including the space
before and after)
1.SalesTotal=Sales Total +Sales
Process Page Break
Write Page Headings
1.Write Sales Total
3.Print “Run Completed”
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.
For data validation, finding errors in the data records.
Another problem that arises when you are working with files is to how to deal with the empty file or null file.