I have a sequential file. How do I access a record in this
sequential file randomly in my program ?

Answer Posted / harish

YS WE CANT ACCESS FLAT FILE RANDOMLY

IF WE WANT TO ACCESS PARTICULAR RECORD



PROCEDURE DIVISION.

MOVE KEYFIELD VALUE TO W-S VARIABLE
PERFORN UNTIL W-FLAG = 'Y'
READ FILE1 AT END MOVE 'Y' TO W-FLAG
NOT AT END
IF KEY-FILE1 = WS-KEY-VARIABLE
MOVE--------

ELSE
MOVE 'Y' TO W-FLAG.

pls correct me if anything wrong

HARISH POOMGAME SHIVAPPA(hassan,karnataka)
NIIT TECHNOLOGY
KOLKATA

Is This Answer Correct ?    0 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which mode is used to operate the sequential file?

666


Give some examples of command terminators?

757


A table has two indexes defined. Which one will be used by the SEARCH?

757


I have one ps file in which there are 3 fileds emp_no,emp_name and leave_app.this ps file information give the detail of employee which is going to apply for leave.suppose emp_no=113430,emp_name=ajay,leave_app=1 that means he is going to apply for 1 day leave.and accordingling the table in db2 will be updated means if he has that no of leave in his account then he will get dat leave and updated acc. in table(leave_balance=previous leave present in table-leave_app).Now i want to check whther the updated result is correct or not by comparing the two ps file using IEBCOMPARE or icetool so what is going to be the two ps file and how its is going to be compare.

2008


Write the code implementing the perform … varying.

644






how do you reference the ksds vsam file formats from cobol programs

666


Explain the configuration section of a cobol program with examples of syntax.

659


Describe the cobol database components?

680


What are the different rules for performing sort operation?

761


Are you comfortable in cobol or jcl?

643


Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

684


How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?

1936


What are all the divisions of a COBOL program?

663


System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..

1588


What are 77 levels used for?

659