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 

How to calculate VSAM total records nubmer?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Data Management
View previous topic :: View next topic  
Author Message
ANDY
Beginner


Joined: 07 Feb 2004
Posts: 127
Topics: 67

PostPosted: Tue Oct 19, 2004 3:01 am    Post subject: How to calculate VSAM total records nubmer? Reply with quote

I want to calculate VSAM file total records number in cobol program. Can someone show me a way?

Thank you.
_________________
cheers,
Andy
Back to top
View user's profile Send private message
sandip
Beginner


Joined: 28 Jul 2004
Posts: 18
Topics: 3

PostPosted: Tue Oct 19, 2004 3:58 am    Post subject: Reply with quote

Is there any bindings that you have to use COBOL? Using LISTCAT, you can easily find the number of records in VSAM file.
Back to top
View user's profile Send private message
cobcurious
Beginner


Joined: 04 Oct 2003
Posts: 68
Topics: 25

PostPosted: Tue Oct 19, 2004 5:13 am    Post subject: Reply with quote

Hi Andy,
I am assuming that you guys use DFSORT.

Use the following code:-
Code:
//STEP001 EXEC PGM=SORT,                                   
//            COND=(0,LT)                                 
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=MY.CICS.CODES,DISP=SHR       
//SORTOUT  DD DSN=MY.COB01020.OT01.COB,           
//            DISP=(NEW,CATLG,CATLG),                     
//            UNIT=SYSALLDA,                               
//            SPACE=(CYL,(5,10),RLSE),                     
//            DCB=(LRECL=80,RECFM=FB)                     
//SYSIN    DD *                                           
  OPTION COPY                                               
  OUTFIL NODETAIL,REMOVECC,                                 
  TRAILER1=(C'RECORD COUNT OF FILE: ',COUNT,80:X)     
/*                                         



In the above code,MY.CICS.CODES is a VSAM file.You will get the result in the dataset MY.COB01020.OT01.COB
Hope this helps
Cheers
Cobcurious
8)
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Oct 19, 2004 6:55 am    Post subject: Reply with quote

Andy,

Please search before posting. If your sole aim is to find the total no: of records in a file , then chekc this link which explains the different ways of getting it.

http://www.mvsforums.com/helpboards/viewtopic.php?t=7&highlight=count

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
ANDY
Beginner


Joined: 07 Feb 2004
Posts: 127
Topics: 67

PostPosted: Mon Oct 25, 2004 2:59 am    Post subject: Reply with quote

Thank you everyone.
_________________
cheers,
Andy
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 -> Data Management 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