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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Mention the guidelines to write a structured cobol program?

603


There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.

923


I have a File that has duplicate records. I need only those records that occur more than thrice.?

8614


How you can read the file from bottom?

654


Write the code implementing the perform … varying.

637






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

697


What is the difference between structured cobol programming and object alternativelyiented cobol programming?

699


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

2536


What is the difference between PIC 9.99 and PIC9v99?

771


Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

671


Difference between array and sub-script ?

1157


What are literals?

622


How to know whether the module is dynamical or statistical?

650


Whats the difference between search & search ALL?

5243


What are the rules of the move verb?

695