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 |
in how many mode we can open a file ?
What is Redefines clause?
RENAME clause takes new SPACE in memory.TRUE or FALSE? a)TRUE 2)FALSE
what is scope terminator
In a program, variables are used but no DB2 involved in it. Can you call it as host variables??
What is the linkage section?
Hi Guys, I have faced one interview question if I have requirement to add 5 new columns to existing table what are prerequisite do i need to take.
What is the significance of 'above the line' and 'below the line'?
If a file has 1000 records.. if i have to replace the first and last characters of the file with another character. how it can be done....
We have 3 programms A,B,C.In the middle of the program A the controls goes to program B and in the middle of the program B control wants to go program C,after completion of program C again control comes to program B and again after completion of program B control comes to program A.How the process will takes and what are the controls we use for that process.If it is possible anybody of you explain with example?
Can anyone please give the example of Inline Perform.
How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that