i have n records in one file and in this file there is some
fields and i want to count that how many sharma in my file
so plz give the coding that how we read sharma ?
Answer Posted / mr. cooooool
HI...........
PLZZZZZZ USE DIS LOGIC.
PROCEDURE DIVISION.
OPEN INPUT FILE1.
PERFORM READ-PARA UNTIL EOF = 'D'.
DISPLAY COUNT.
CLOSE FILE1.
STOP RUN.
READ-PARA.
READ FILE1
AT END
MOVE 'D' TO EOF
NOT AT END
PERFORM INSPECT-PARA
END-READ.
INSPECT-PARA.
INSPECT NAME TALLYING COUNT FOR ALL 'SHARMA'.
COUNT IS A WORKING-STORAGE VARIABLE WHICH WILL COUNT THE
OCCURENCE OF 'SHARMA'.
THANKS
REGARDS
RAVINDRA BISHT
| Is This Answer Correct ? | 11 Yes | 0 No |
Post New Answer View All Answers
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?
I have a File that has duplicate records. I need only those records that occur more than thrice.?
What is redefines clause in COBOL?
What are the cobol coding sheets?
what is search and searchall?what is the diffrence between them?give an best example?
Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?
example for sub strings ? and refernce modifications whit output pls
input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.
I have to write to a outfile where the number of records in that file should be the header of that file using IMS.. can anyone help me in this issue
i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this
What is the default value(s) for an initialize and what keyword allows for an override of the default?
i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc
INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
What are the various section in data division and briefly explain them.