Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
PROGRAM FOR INDEXED SEQUENTIAL FILE CREATION (RANDOM MODE):
We have to write a program to create an Indexed Sequential File in random mode for Student particulars. Suppose just 2 fields: rno(Roll Number), name(Name of Student)
identification division.
program- id.
environment division.
input-output section.
file-control.
select stu- file assign to disk
organization is indexed
access mode is random
record key is rno
file status is fs.
data division.
file section.
fd stu- file
label records are standard
value of file- id is "stu.dat".
01 stu-rec.
02 rno pic 9(3).
02 name pic x(20).
working-storage section.
01 fs pic x(2) value spaces.
01 ans pic x value space.
procedure division.
p-1.
open i-o stu-file.
if fs = "30"
open output stu-file
close stu-file
perform g-w-para until ans = "n".
close stu-file.
stop run.
g-w-para.
display(1 1) erase.
display(3 5) "Rno : ".
accept rno.
display(5 5) "Name : ".
accept name.
write stu-rec invalid key display(15 5) "Error!".
display(20 5) "Continue [y/n] : ".
STATEMENTS FOR SEQUENTIAL FILES: A basic operation on a file includes the reading and writing of its records. Whenever the file is sequential, there are three verbs for the
FILE-CONTROL paragraph for the indexed files: The common format for the SELECT clause for a file is as shown below: SELECT file-name ASSIGN TO implementor -name
PROGRAM FOR CONDITION NAMES: We have to write a simple program to demonstrate Condition names usage. identification division. program- id. environment division.
File Activity: The file activity is a measure of the proportion of records processed during an update run. Therefore we define the activity ration as shown below. Activi
RENAMES CLAUSE: At times re-grouping of an elementary data items in a record may be essential so that they can belong to the original as well as to the latest group. This is o
Illustration of Search verb: To illustrate the other use of SEARCH verb, assume we wish to search the similar tab to find the number of persons whose deposited amount is more
Group Item as Operand in the Relational Condition: Whenever an operand of a relational condition is the group item, the item is then considered to be an alphanumeric field. Th
Example of Accept statement: For illustration, ACCEPT FLAG-A can be specified to read the value of the FLAG_A from the console. It may be keep in mind that no file definition
IF ... ELSE STATEMENT: We are familiar with an easy form of the IF statement. The common form of the IF statement is as shown below: Each of the statement-1 and statem
B (Blank Insertion) : The occurrence of a B anyplace in the picture will insert a space character in the edited data. There can be more than one B in the picture. Examples:
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd