Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



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

Answer / srinivas.d

you cannot randomly acces in sequential files..

Is This Answer Correct ?    9 Yes 3 No

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Post New Answer

More COBOL Interview Questions

how to crack cts interview apps? NOVEMBER 21 2010

2 Answers   CTS,


If there are two files one with 100 records and other with 101 records. we have to find out the one record that is the odd man out . What are the steps to do it

7 Answers   BirlaSoft,


what is mainframe? what is the mainframe software ? what is use in s/w field?

7 Answers   CSE,


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

0 Answers  


What is a report item?

0 Answers  


If we put three reads in COBOL in the same para one after the other, to read a PS file,will it read the same record thrice or it will read three records sequentially? For example : Input File 01 02 03 Para 900 Read infile Display Infile rec Read infile Display infile rec Read infile Display infile rec. What will be the output?

2 Answers  


what is meaning by design document? who can repared for this?

5 Answers   TCS,


If A>B next sentence end-if display 1 display 2. display 3. If a>b, it will display only 3.(the next sentence, ie., after fullstop/period) ____________________________________ if a>b continue end-if display 1 display 2. display 3. If a>b, it Will display 1 2 3 (the next statement) ____________________________________ if a>b continue display 1 end-if display 2 display 3. display 4. If a>b, Will it display 2 3 4 (or) 1 2 3 4 ?

8 Answers   UST,


What compiler option would you use for dynamic linking?

2 Answers  


What are the divisions in a cobol program? Which one is the mandatory division among them?

1 Answers  


How to replace the GOTO statement in COBOL without changing the structure of program. e.g. consider following code... I.D. E.D. D.D. P.D. compute C = A + B. GOTO para 100-display. compute D = C - D. GOTO 200-display. some other logic...... ........ GOTO 300-para. ...... ...... GOTO 400-para. Now I want to replacce all GOTO statements without changing the structure and otput of program.

6 Answers   Accenture,


ID DIVISION. PROGRAM-ID. PLO. DATA DIVISION. WORKING-STORAGE SECTION. 01 VAR1 PIC 9(2). 01 VAR2 PIC X(2). PROCEDURE DIVISION. ACCEPT VAR2. MOVE VAR2 TO VAR1. STOP RUN. if i give 'PI' in var2 then what will b output of progr. any abend?????

6 Answers   TCS,


Categories