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
Is it possible that the redefines clause has different picture clauses compared to the one it redefined?
how do you reference the variable block file formats from cobol programs
Difference between array and sub-script ?
How many sections are there in data division in COBOL?
explain sorting techniques in cobol program?
What are the pertinent COBOL
How can we find that module can be called – whether DYNAMICALLY or STATICALLY?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
How can you get the ksds file records into your cobol program?
What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?
How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.
What is the difference between binary search and sequential search?
A table has two indexes defined. Which one will be used by the SEARCH?
What are the different rules of SORT operation?
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.