MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Total Number of records in Files

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
kappurajesh
Beginner


Joined: 29 Mar 2004
Posts: 19
Topics: 13
Location: India

PostPosted: Mon Apr 26, 2004 9:49 am    Post subject: Total Number of records in Files Reply with quote

How to get the total number of records in Cobol Files (Sequential or relative or indexed)
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12382
Topics: 75
Location: San Jose

PostPosted: Mon Apr 26, 2004 9:53 am    Post subject: Reply with quote

Kappuramesh,

You will not get any answers for your queries until you answer the queries I have requested. Answer my queries in this topic.

http://www.mvsforums.com/helpboards/viewtopic.php?p=10095
http://www.mvsforums.com/helpboards/viewtopic.php?p=10094

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Tue Apr 27, 2004 11:23 am    Post subject: Reply with quote

Hi Kolusu,

Looks like he answered your ques in the 1st thread you cited. Or don't you believe him?

Regards, Jack.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12382
Topics: 75
Location: San Jose

PostPosted: Tue Apr 27, 2004 3:02 pm    Post subject: Reply with quote

Slade,

Quote:

Looks like he answered your ques in the 1st thread you cited. Or don't you believe him?


I did not visit this topic today . It is not that I don't beleive him , it is just that I lost interest in answering the questions after that incident. well I will take stab at this question.

Rajesh,

I want to make it clear that there is no command in cobol where you can get the total no: of records in a file. However there are many ways to get the total no: of records.
But If you want to get it via a cobol program , then the simplest way is to read all the records incrementing the counter till the end of file.

Code:

01 TOTAL-INPUT-RECS          PIC +9(09) VALUE ZEROES.
01 S-EOF-IN1                 PIC X(01) VALUE 'N'.

PROCEDURE DIVISION.

   OPEN INPUT  IN1-FILE                           
                                               
   PERFORM READ-IN1-FILE  UNTIL S-EOF-IN1 = 'Y'                     
   
   CLOSE IN1-FILE         
     
   DISPLAY 'THE TOTAL NO: OF RECORDS IN THE FILE: ' TOTAL-INPUT-RECS

   GOBACK                 
   .                                                                   
                                                             
 READ-IN1-FILE.                                         
*************************************************************
*THIS PARAGRAPH READS THE IN1-FILE                          *
*************************************************************
                                                             
     READ IN1-FILE                                           
         NOT AT END                                       
             ADD +1              TO TOTAL-INPUT-RECS     
         AT END                                               
             MOVE 'Y'            TO S-EOF-IN1                 
     END-READ                                                 
     .                                                       



Hope this helps....

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Tue Apr 27, 2004 6:27 pm    Post subject: Reply with quote

I don't see why we should be helping people get jobs and sit exams that they clearly don't have the knowledge to get or sit themselves!!! Answering other people's interview/exam questions is effectively helping them to cheat. You may be giving an inferior person a chance at landing a job or qualification over better qualified people.

I thought these forums were for us to help our mainframe peers solve problems which aren't already documented somewhere (either in manuals or in the forums), not just answer simple technical questions from students and opportunistic job seekers that are readily answered in technical manuals.
_________________
My opinions are exactly that.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group