How to retrive the 9th records out of ten records using the
cobol program ?
Answers were Sorted based on User's Feedback
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 |
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 |
What do you feel makes a good program?
what are the steps to sort in a cobol program?
what happens if we wont give timestamp in precompilation process ?
I have a COBOL main program which is calling sub program, the number of calling parameters used in main program are 4 whereas in sub program it's 5. Sub program is passing 5 parameters back to main program Will there be any compilation error? Or main program parameters displays junk values?
How is sign stored in a COMP field ?
COMP field occupy ?
What is the meaning of 'Eject' verb in cobol?
What are the steps you go through while creating a COBOL program executable?
How to use the same COBOL program in Batch and CICS on lines? explain with an example
Write a program to explain size error.
Q:what is the difference between the variable length and fixed lenght.how it varies in the cobol.
State the various causes of s0c1, s0c5 and s0c7.