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 ?
Answers were Sorted based on User's Feedback
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 |
using SORT UTILITY(OUTFIL) AND THROUGH SORT(OUTREC),its
possible..
..
1)THROUGH SORT UTILITY(OUTFIL):
//S1 EXEC PGM=SORT
//F1 DD DSN=....
.
.
//SYSIN DD *
SORT FILEDS=(1,4,CH,A)
OUTFIL FILE 1 INREC FIELDS=(10,5,CH,EQ,C'SHARMA')
*/
//
2)THROUGH SORT(OUTREC):
//S1 EXEC PGM=SORT
//DD1 DD DSN=....
//DD2 DD DSN=.... Where o/p contains SHARMA will move into DD2
.
.
//SYSIN DD *
SORT FILEDS=(1,4,CH,A)
OUTREC FIELDS=(10,5,CH,EQ,C'SHARMA')
*/
//
Is This Answer Correct ? | 0 Yes | 4 No |
wirte a pgm in using files in which we hav 10 ,20,30 40...100 records in inputfile and i want them to be send to outputfile in reverse order. PLZ HELP ME OUT .........THIS IS A RECENT QUESTION IN IGATE..
how to convert the recors form vsam file to db2 table tru file aid
If we use GO BACK instead of STOP RUN in cobol?
How can we increase the size of an existing PDS to include more no. of modules.
TYPES OF SORTINGS. which is more prefarable.
Why we need to use redefine clause when we can define the variable seperately... what is actual need....
Extract only those records from a PS file which are having word 'TEXT' in the records using COBOL? The word TEXT is not present in a particular position in all the records.
file status 00 is checked after opening the file or reading the file
I have a sequential file of 100 records. How do I load the records into a two dimensional array ?
please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?
how to transfer the file from pc to mainframe??
What is the difference between a binary search and a sequential search?