WEEK10 - Week10 FileProcessing...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Click to edit Master subtitle style  3/14/11  Dr. Lale T. Ergene Week 10 File Processing
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
 3/14/11  Dr. Lale T. Ergene 22 Introduction o The most convenient way to process involving large data sets is to store them  into a file for later processing. o  In order to work with files we need to focus  on  I/O   operations, data transfer and file  operations.
Background image of page 2
 3/14/11  Dr. Lale T. Ergene 33 Information for data transfer Data transfer characteristics are specified by the following  items called  control information . o The direction of data transfer (input or output) o The external device, or unit, to or from which data is to be transferred o The format description that specifies conversion between  the computer-oriented internal form of data and its  representation as a character string.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
 3/14/11  Dr. Lale T. Ergene 44 Direction of Transfer The direction of transfer is determined by the initial  keyword in the statement. The keyword  read   denotes  input , while  write   denotes  output . External Device Each external device is identified with a unique integer value called a unit number. A given unit number represents the same device in the main   ( I/O Statements
Background image of page 4
 3/14/11  Dr. Lale T. Ergene 55 ( I/O Statements An input or output statement has the following form: read(unit=2,fmt=”(2i5, a,2f16.8)”) I,Code,Str,Bugle,Dpr write(unit=*,fmt=”(f10.3,i6,f10.3,a)”) A,B,C,” # ” write (unit=*, fmt=*) Code, X+Y+Z
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
 3/14/11  Dr. Lale T. Ergene 66 ( I/O Statements o input read (control list) list read (unit=1,fmt=“(i4,f3.2)”) Inum, Aver o output write (control list) list write (unit=6,fmt=“(i4,f3.2)”) Inum,Aver print (format specifier) list print *, Inum, Aver
Background image of page 6
 3/14/11  Dr. Lale T. Ergene 77 Control List unit specifier :  External unit/device to/from data is  transferred  – unit= format specifier :  Explicit specification of conversion between internal and external data – fmt= positioning, i/o status other specifiers
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
 3/14/11  Dr. Lale T. Ergene 88 Data Transfer RECORDS Information on a file subdivided into records. A record corresponds roughly to a line on a terminal screen or to a printed line. The structure of unformatted records is processor-dependent, since the amount of space required on the external unit depends on the details of processor data representation. 
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 25

WEEK10 - Week10 FileProcessing...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online