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...


How to retrive the 9th records out of ten records using the
cobol program ?

Answers were Sorted based on User's Feedback



How to retrive the 9th records out of ten records using the cobol program ?..

Answer / kk

Hi,

just use count variable in working storage.then when read
the file add 1 to count.after that u give if statement if
count = 9 display rec.

Is This Answer Correct ?    20 Yes 0 No

How to retrive the 9th records out of ten records using the cobol program ?..

Answer / ramesh

IDENTIFICATION DIVISION.
PROGRAM-ID. RAMESH.
ENVIRONMANT DIVISION.
DATA DIVISION.
FILE-SECTION.
FD INFILE.
01 IN-REC
05 NAME
05 AGE
WORKING-STORAGE SECTION.
01 WS-COUNT PIC 99.
PROCEDURE DIVISION.
ACC-PARA.
accept ws-num
move 0 to ws-count
ADD-PARA.
read infile
add 1 to ws-count.
perform add-para until ws-count = ws-num

display in-rec.

Note: as per ur requirementprovide ws-num=9
COMPILE IT .PASS WS-NUM THRU RUN JCL SYSIN AS 9 .You will
get the 9th record.

Is This Answer Correct ?    10 Yes 0 No

How to retrive the 9th records out of ten records using the cobol program ?..

Answer / shan

If you are sure that ur file will always have 10 records,
then move high-values to record format and read prior twice.

Is This Answer Correct ?    6 Yes 6 No

Post New Answer

More COBOL Interview Questions

db2 variable decimal(15,2) what is the equalent size of cobol variable

2 Answers   Syntel,


what if any ,is the syntex error in the following piece of code 01 B PIC A(7) 02 C PIC 9(4) ........ IF(B NUMERIC) ADD 10 TO C a.the condition in the if statement is wrong b.noting is wrong c.because C is initialised.ADD 10 TO C is wrong d.both B and C shoud have same size.

5 Answers   TCS,


What is R-mode and A-mode?

3 Answers   TCS,


what is lrec=f,what is difference between f,fb,v,vb?what is default value?how do we came to know that records are in f,fb,v,vb?

2 Answers   IBM, Wipro,


COBOL Snippet: Tell where the control will when the below code execute IF (A=B) CONTINUE ELSE NEXT SENTENCE PERFORM <IMP-STMT> END-IF.

7 Answers   HCL,


I hav vari declaration like..... 77 a pic s9(9).99. 77 b pic s9(9).99 comp. 77 c pic s9(9).99 comp-3. if i use MOVE 123456789.99 to a,b,c what happen every one working fine ?

1 Answers   Mphasis,


Can 88 level variable be declared in FD section..?

1 Answers   Infosys,


When would you use in-line perform?

2 Answers  


How to read a 100 record from a file through cobol?

2 Answers  


What is COMP-1? COMP-2?

4 Answers   CitiGroup,


What are the different data types available in COBOL?

4 Answers  


How can you add a particular field/coloumn in copybook?

3 Answers   ADP, DELL, L&T,


Categories