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 |
A s9(4). B v9(4) value 0.21 can i move this?
What is an in line perform? When would you use it? Anything else you wish to say about it.
Explain the difference between an internal and an external sort, the pros and cons, internal sort syntax etc.
What is the difference between performing a SECTION and a PARAGRAPH?
how do u indetify files succesfully executed or not ?
How many variables can be declared in w-s section.?
if a pic 9(3) value 354,b pic x(2) value '46' then a)a>b 2)a<b 3)error
How do you reference the fixed block file formats from cobol programs
what is lrec=f,what is difference between f,fb,v,vb?what is default value?how do we came to know that records are in f,fb,v,vb?
how to transfer the file from pc to mainframe??
In file1 have 80 records are like d1,d2,d3......D80. File2 have 1000records are like a1d1,a1d2,a3d3.....Etc. I want matching records in file3 ? Plse tell me the matching logic???I want answer only in cobol ?Not using any tool or jcl?
What is EIBCALEN? Why it is used?