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

input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.

1777


What are the cobol coding sheets?

661


How do you reference the fixed block file formats from cobol programs

702


What is an in line perform? When would you use it? Anything else you wish to say about it.

641


Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc

818






how do you reference the variable unblock file formats from cobol programs

743


Which mode is used to operate the sequential file?

658


How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?

2093


how can i see junk values in dclgen or in hostvariable of comp ?

2541


What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?

709


What is a SSRANGE and NOSSRANGE?

818


what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.

8156


how do you reference the printer file formats from cobol programs

655


I have File 1 occurs 5 times with Employee-ID,Employee-Name,Employee-Dept (EEE and MECH). I have File 2 occurs 10 times with Employee-ID,Employee-Name,Employee-Dept (EEE,CIVIL,CHEMICAL and MECH). In FIle 1 and FIle 2 , for matching Employee-DEPT (Only MECH) , we need to move entire records from file1 to file 2. We should not use 2D array. Your help is needed here.

1113


Write a program to explain size error.

669