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 is the difference between a subscript and an index in a table definition?
Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.
how to refer the data field?
How to execute a set of JCL statements from a COBOL program?
What is the Importance of GLOBAL clause According to new standards of COBOL?
in cobol i have one file it contains records like 10,4,23,98,7,90..... total records 100. iwant 10 to 20 in reverse order in cobol environ ment any one please give the answer......
What happens in the background of spool when we submit a job for compilation and execution... This is a recent question in ibm...Kindly help me.....
How do you reference the following file formats from cobol programs?
What happens when we move a comp-3 field to an edited (say z (9). Zz-)?
Can anybody give me example of subscript and index
The disposition parameter in the jcl is share ( DISP+SHR ) and the program opens file in extend mode what will happen?
Can you call an OS VS COBOL pgm from a VS COBOL II pgm ?