IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to find number of records in a file through TSO


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sureshindira

New User


Joined: 21 Feb 2005
Posts: 10

PostPosted: Wed Apr 06, 2005 11:01 am
Reply with quote

How to find number of records in a file through TSO?
Back to top
View user's profile Send private message
sivatechdrive

Active User


Joined: 17 Oct 2004
Posts: 191
Location: hyderabad

PostPosted: Wed Apr 06, 2005 12:15 pm
Reply with quote

Hi sureshindira

Use the REPRO command in TSO on the right-most corner we can see number of records processed.




Thanks
siva
Back to top
View user's profile Send private message
Great Indian

New User


Joined: 05 Apr 2005
Posts: 9

PostPosted: Wed Apr 06, 2005 3:35 pm
Reply with quote

what sureshindira told is wrong.
If you want to see no of records are there in any member of PDS then see the size of member(this is the column exists when you open PDS)
without opening member
Here is the example:

Name Prompt Size Created Changed
CBLPGM1 31 2005/04/06 2005/04/06 01:09:04
CBLPGM1R 16 2005/04/06 2005/04/06 01:00:02
COMPILE 34 2005/03/07 2005/03/07 05:09:11
COMPJCL1 63 2005/02/20 2005/04/06 00:49:45
COMPJCL2 65 2005/04/04 2005/04/04 23:00:10
CPYBOOK 5 2005/01/31 2005/02/03 05:27:18
EXCEL 25 2005/01/06 2005/02/11 08:29:48
GDGCRE1 68 2005/01/26 2005/01/26 21:41:50

--------------------------------------------------------------------------
If you want to know no of records in QSAM(PS) file then open the file in browse or view mode....give "m" on command line and press f8 it will go to last record in file....here by seeing last record number you can estimate the number of records exist in QSAM file
Back to top
View user's profile Send private message
ankyhunk

Moderator


Joined: 05 May 2005
Posts: 98
Location: Navi Mumbai, India

PostPosted: Thu May 05, 2005 6:34 pm
Reply with quote

As great indian said, you can open any file in browse,edit or view mode. The type 'm' on command line & press 'F8'. You will find the total no of records on the right hand top corner.
Back to top
View user's profile Send private message
ashokreddy

New User


Joined: 20 May 2005
Posts: 4
Location: india

PostPosted: Fri May 20, 2005 2:37 pm
Reply with quote

hi,
i guess thru TSO WE CAN GET THE BELOW WAY,

TYPE
TSO LISTCAT ENT ('YOUR.DATASET.NAME') ENT

YOU WILL GET YOUR SOLLUTION.
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Fri May 20, 2005 2:50 pm
Reply with quote

I don't know if in some installation the command LISTCAT answer to the main request but I think that very difficult...
I'm in accord with the "Great Indian"...
Back to top
View user's profile Send private message
spanda

New User


Joined: 31 Aug 2005
Posts: 48
Location: U.K.

PostPosted: Thu Sep 01, 2005 3:23 pm
Reply with quote

Hi,

If you have File-Aid at your site, then you can find the number of records in a flat file using the interactive facility of File-Aid (option 3.8 in File-Aid ver 8.9) and when you are prompted for the function, type 'Tally' to get the number of records. It works much faster than scrolling down to the bottom of the file, particularly when you have millions of records in the file.

Personally, I use a rexx util called COUNTX, which can be used at the DSLIST panel (3.4) as a line command. This is fast enough for most purposes. I had downloaded this from cbttapes. If you want, I can send it to you.

HTH,
Panda.
Back to top
View user's profile Send private message
leo_sangha

New User


Joined: 11 Aug 2005
Posts: 85
Location: England

PostPosted: Wed Sep 28, 2005 9:09 pm
Reply with quote

ashokreddy wrote:
hi,
i guess thru TSO WE CAN GET THE BELOW WAY,

TYPE
TSO LISTCAT ENT ('YOUR.DATASET.NAME') ENT

YOU WILL GET YOUR SOLLUTION.




Hi AshokReddy,

I tried the TSO command you have given as a reply ...

TSO LISTCAT ENT ('MYFILE.RECORDS')

But this is what i get as a result

NONVSAM ------- MYFILE.RECORDS
IN-CAT --- CATALOG.NAME


It did NOT give the number of records in the FILE but it gave Type & Catalog name for the file.
Is there any TSO command by which we can get number of records in the File ?????? This Q? is still not solved.

Thanks
leo_sangha@yahoo.com
Back to top
View user's profile Send private message
Kevin

Active User


Joined: 25 Aug 2005
Posts: 234

PostPosted: Wed Sep 28, 2005 9:16 pm
Reply with quote

leo_sangha wrote:
Is there any TSO command by which we can get number of records in the File ?????? This Q? is still not solved.


No, there isn't. You'll need to write your own routine.
Back to top
View user's profile Send private message
leo_sangha

New User


Joined: 11 Aug 2005
Posts: 85
Location: England

PostPosted: Thu Sep 29, 2005 2:52 pm
Reply with quote

Kevin wrote:
leo_sangha wrote:
Is there any TSO command by which we can get number of records in the File ?????? This Q? is still not solved.


No, there isn't. You'll need to write your own routine.


Kevin,
Thanks for the information. I was hoping that Ashok might be of help here as he has posted before that we can do it, though not correctly.

Thanks
leo_sangha@yahoo.com
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Wed Jun 15, 2011 11:36 am
Reply with quote

follow on
why using rexx for large amount of data is not resource effective !

to count a 300000 record FB 252 PS dataset
dfsort
Code:
000014 //SYSIN     DD *
000015   SORT      FIELDS=COPY
000016   OUTFIL    REMOVECC,NODETAIL,
000017             TRAILER1=(C'COUNT ',COUNT=(M11,LENGTH=7),80:X)

IEF374I STEP/ICE     /STOP  2011166.0738 CPU    0MIN 04.80SEC SRB    0MIN 00.06SEC VIRT  1088K SYS   272K EXT    8224K SYS   10752K

icetool
Code:
000009 //TOOLIN    DD *
000010   COUNT  FROM(SORTIN)

IEF374I STEP/COUNT   /STOP  2011166.0738 CPU    0MIN 05.09SEC SRB    0MIN 00.07SEC VIRT  1040K SYS   272K EXT    6164K SYS   10760K


REXX/EXECIO scripts
Code:


000009 /* REXX */
000010 trace "o"
000011 chunk = <number of records for each execio>
000012 count = 0
000013 Address TSO "EXECIO "chunk" DISKR SYSUT1 ( STEM BUFFR."
000014 do while ( buffr.0 = chunk )
000015    count = count + chunk
000016    Address TSO "EXECIO "chunk" DISKR SYSUT1 ( STEM BUFFR."
000017 end
000018 count = count + buffr.0
000019 say " count = " count
000020 exit


000009 /* REXX */
000010 trace "o"
000011 Address TSO "EXECIO * DISKR SYSUT1 ( STEM BUFFR."
000012 say " count = " buffr.0
000013 exit



1 record at the time
Code:

chunk = 1

IEF376I  JOB/ENRICO1 /STOP  2011166.0814 CPU    2MIN 43.44SEC SRB    0MIN 00.41SEC VIRT   180K SYS   412K EXT     328K SYS   11108K


1000 records chunks
Code:

chunk = 1000

IEF374I STEP/S2      /STOP  2011166.0811 CPU    0MIN 30.57SEC SRB    0MIN 00.41SEC VIRT   180K SYS   412K EXT     648K SYS   11036K


one shot
Code:

IEF374I STEP/S2      /STOP  2011166.0815 CPU    0MIN 41.59SEC SRB    0MIN 00.41SEC VIRT   180K SYS   412K EXT  100456K SYS   11036K


the elapsed was just a bit higher
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 4
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts how to eliminate null indicator value... DB2 7
No new posts To Omit records based n SORT condition DFSORT/ICETOOL 6
No new posts sort to find out the char which repea... Mainframe Interview Questions 10
Search our Forums:

Back to Top