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
Mention the guidelines to write a structured cobol program?
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.
I have a File that has duplicate records. I need only those records that occur more than thrice.?
How you can read the file from bottom?
Write the code implementing the perform … varying.
How do you reference the fixed block file formats from cobol programs
What is the difference between structured cobol programming and object alternativelyiented cobol programming?
how can i see junk values in dclgen or in hostvariable of comp ?
What is the difference between PIC 9.99 and PIC9v99?
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
Difference between array and sub-script ?
What are literals?
How to know whether the module is dynamical or statistical?
Whats the difference between search & search ALL?
What are the rules of the move verb?