I have a sequential file. How do I access a record in this
sequential file randomly in my program ?
Answers were Sorted based on User's Feedback
Answer / srinivas.d
you cannot randomly acces in sequential files..
| Is This Answer Correct ? | 9 Yes | 3 No |
Answer / guest
Harish ,
What is "KEY-FILE1" ?
Anyhow - you are still reading file sequentially ? arnn't
you ?
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / sruthi
we can do that by using tables means arrays concept.
we can use search all for that
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / jack
Read seq. file and store it in tables means arrays.
We can use 'seach all' for random access.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / mohan
Guys, i suppose that we need to use Arrays concept along
with Subscript or Index concept to access a record in a
sequential file.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / santhosh
write a temporary index file defining unique key, move the
sequential file to that temp index file and access the temp.
index file randomly
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / lu
Hi Guys,
when you say "sequential" it means you have to read from 1
to 9999...Never say sequential file and read randomly !!!!!
use read util the field you want....
Perform 100-read until ws-field = 'yes'.......
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / 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 |
What is file status 39 ?
how will you define vsam file in select clause?
which of the following can be used as a check protection symbol a.Z b.S c.* d.+
s9(18) comp-3:: What is the size of memory it takes internally?
How do u find the programs calling the given module, without having doing 3.13 on loadlib/source library?
What is Comm?
2 Answers IBM, Kemper Corporation,
What is the difference between PIC 9.99 and 9v99 in COBOL?
0 Answers SwanSoft Technologies,
what is MSGLEVEL?
How many maximum number of procedures can we write in one COBOL program?
01 MOVE 10 TO N 05 PERFOM PARA1 TIMES STOP RUN WAT WILL HAPPEN?? WILL IT RUN INFINITELY OR AN ERROR WIL BE THER BECAUSE NO OF TIMES IS NOT GIVEN??
There is a variable with value 19446. Requirement is to convert it to 194.46. I tried it by doing divide by 100 and my receiving field data type is 9(03)v99. But the output is 194. I am not getting the decimal value. Could anyone pls let me know how to get this done?
A s9(4). B v9(4) value 0.21 can i move this?