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
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.
What are the cobol coding sheets?
How do you reference the fixed block file formats from cobol programs
What is an in line perform? When would you use it? Anything else you wish to say about it.
Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc
how do you reference the variable unblock file formats from cobol programs
Which mode is used to operate the sequential file?
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?
how can i see junk values in dclgen or in hostvariable of comp ?
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?
What is a SSRANGE and NOSSRANGE?
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
how do you reference the printer file formats from cobol programs
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.
Write a program to explain size error.