how can we find total no of records in a file ....is there
any utility......?

Answers were Sorted based on User's Feedback



how can we find total no of records in a file ....is there any utility......?..

Answer / vivek c

Use ICETOOL utility as below.

//TOOLIN DD *
COPY FROM(IN1) USING(CTL1)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,
TRAILER1=('FILE1',5X,COUNT=(M10,LENGTH=5))
/*

Is This Answer Correct ?    5 Yes 0 No

how can we find total no of records in a file ....is there any utility......?..

Answer / varsha

//SYSIN DD *
INREC FIELDS=(1,4,C'00001')
SORT FIELDS=(01,04,CH,A)
SUM FIELDS=(05,05,ZD,A)
OUTREC FIELDS=(01,04,05,05)
/*
Briefly, I'm adding a numeric 00001 to each record and
sorting them on the numeric field and summing all such
records, which will give you the desired output.

Is This Answer Correct ?    1 Yes 0 No

how can we find total no of records in a file ....is there any utility......?..

Answer / roger caviness

fileaid

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More COBOL Interview Questions

What are declaratives and what are their uses in cobol?

0 Answers  


What guidelines should be followed to write a structured Cobol program?

1 Answers  


How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?

0 Answers  


Consider the following: 77 A PIC 9(10) 77 B PIC 9(10) 77 C PIC 9(19) MULTIPLY AB BY B GIVING C Which of the following is true ? (a) The execution of the above may result in size error. (b) The execution of the above will result in size error. (c) The definition of C is invalid resulting in compilation error. (d) No error will be thee and the program would proceed correctly.

4 Answers   TCS,


input:- A 10 20 30 40 B 5 7 10 14 C 8 12 14 16.... output:- A = 100,B=36,C=50. Here spaces are considered between numbers. When we give input as above, the numbers should be added n displayed.So please help me out.

4 Answers  






01 MOVE 10 TO N 05 PERFOM PARA1 TIMES STOP RUN WAT WILL HAPPEN?? WILL IT RUN INFINITELY OR AN ERROR WIL BE THER BECAUSE NO OF TIMES IS NOT GIVEN??

1 Answers  


What is JOBLIB and STEPLIB in JCL? what is the purpose of using it?

1 Answers  


what is the advantage of using redefines instead of delaring the variables ?

5 Answers   HCL,


what is scope terminator

2 Answers   IBM,


What is the difference between a subscript and an index in a table definition?

3 Answers   TCS,


What is tne need to use sub programs in Cobol?

3 Answers   HSBC,


plz any one tell clearly the justify right clause?

1 Answers  


Categories