Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Number of Records in a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sibi Yohannan

New User


Joined: 15 Apr 2009
Posts: 47
Location: Bangalore

PostPosted: Fri Jan 15, 2010 10:04 am    Post subject: Number of Records in a file
Reply with quote

Please advice me on the below.

There is a to and fro file transaction happens between two systems.

I have a requirement to verify the number of records received with the Number of records that I actually send.

Is there any utility to count the number of records in a Flat file. Today we use a simple COBOL program to get the count using the file.
Back to top
View user's profile Send private message

Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Fri Jan 15, 2010 10:06 am    Post subject:
Reply with quote

Your sort product is probably the easiest and quickest way. Use the search facility at the top of this screen and you'll get lots of hits.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Jan 15, 2010 10:08 am    Post subject:
Reply with quote

Hi,

SORT and FILEAID come to mind.


Gerry
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jan 15, 2010 10:31 am    Post subject:
Reply with quote

found these threads from google 'IBM count number of records in file'

these are DFSORT threads:
http://www.ibmmainframes.com/about38217.html
http://ibmmainframeforum.com/viewtopic.php?f=16&t=672&sid=8c8913c75aaee72504a970f42d437b65p2583

this is a syncsort thread:
http://ibmmainframeforum.com/viewtopic.php?f=61&t=2190&sid=6d6289370e1025cf43df0b8d9a11bf91p8228

this is a fileaid thread:
http://ibmmainframeforum.com/viewtopic.php?f=16&t=547&sid=8c8913c75aaee72504a970f42d437b65p2081

you will notice 3 of the 4 are in the beginners forum.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Fri Jan 15, 2010 10:40 am    Post subject:
Reply with quote

Google will oftentimes yield better results than a bulletin boards own search facility.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jan 15, 2010 10:57 am    Post subject:
Reply with quote

Terry,

one wonders
if google does better searches,
or
has a better interpreter of 'what did he mean by that?'.
Back to top
View user's profile Send private message
sibi Yohannan

New User


Joined: 15 Apr 2009
Posts: 47
Location: Bangalore

PostPosted: Fri Jan 15, 2010 11:25 am    Post subject: Number of Records in a file
Reply with quote

Thank you very much for your advice.


Code:
//STEP04   EXEC PGM=ICETOOL,                                       
//            COND=(1,EQ)                                         
//*                                                               
//TOOLMSG      DD  SYSOUT=*                                       
//DFSMSG       DD  SYSOUT=*                                       
//*                                                               
//IN1          DD  DSN=FILE-1                                     
//            DISP=SHR                                             
//*                                                               
//IN2          DD  DSN=FILE-2                                     
//            DISP=SHR                                             
//*                                                               
//OUT          DD  DSN=OUTFILE                                     
//            DISP=(NEW,CATLG,DELETE),                             
//            UNIT=SYSDA,SPACE=(TRK,(200,20),RLSE),               
//            DCB=(RECFM=VB,LRECL=1060,BLKSIZE=0)                 
//*                                                               
//*                                                             
//TOOLIN       DD  * *** CONSTANT CONTROL CARDS ***             
   COPY FROM(IN1) TO(OUT) USING(CTL1)                           
   COPY FROM(IN2) TO(OUT) USING(CTL2)                           
//*                                                             
//CTL1CNTL     DD  * *** CONSTANT CONTROL CARDS ***             
   OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,TRAILER1=(COUNT)         
//CTL2CNTL     DD  * *** CONSTANT CONTROL CARDS ***             
   OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,TRAILER2=(COUNT)         
/*                                                             
//               



I am trying with the above code,
The requirement is like i have 2 input datasets and the number of records in each dataset should be written as separate record in a single output file.
But the above code gives only the Second file count,

I am looking for an output like below in the same output file
Count of IN1 File
Count of IN2 File

Please advice.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jan 15, 2010 1:31 pm    Post subject:
Reply with quote

suggest you repost in the dfsort/icetool forum
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Jan 15, 2010 1:39 pm    Post subject: Reply to: Number of Records in a file
Reply with quote

quoting verbatim expat with the proper legalese about copyright, IP ownership, fair use assumption, the usual blah blah icon_wink.gif
Quote:
Because the solution for sort related questions may vary from product to product, please ensure that you state clearly which sort product you are using.

If you are not sure, then by running a simple sort step shown below, you will be able to find out for yourself.

If the messages start with ICE then your product is DFSORT. Please also post the output of the complete line which has a message code ICE201I, as this will enable our DFSORT experts to determine which release of DFSORT that you have installed. This may also affect the solution offered.

If the messages start with WER or SYT then the product is SYNCSORT and should be posted in the JCL forum. Please also post the information telling which version of SYNCSORT is installed, as this may also affect the solution offered.

Thank you for taking your time to ensure that the valuable time of others is not wasted by offering inappropriate solutions which are not relevant due to the sort product being used and/or the release that is installed in you site.

Code:
//SORTSTEP EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY


You also need to provide more detail than you already have.

What is the DSORG, RECFM & LRECL of the input file.


and after thatI' ll move to the proper forum

I guess it' s just time to open a new section ...
"counting forum"
along with "duplicate elimination",
and ... ... ...
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Jan 15, 2010 2:00 pm    Post subject:
Reply with quote

Hi,

change your TRAILER2 to TRAILER1 and change the
DISP=(NEW,CATLG,DELETE) to DISP=(MOD,CATLG,DELETE)


Gerry
Back to top
View user's profile Send private message
sibi Yohannan

New User


Joined: 15 Apr 2009
Posts: 47
Location: Bangalore

PostPosted: Fri Jan 15, 2010 2:05 pm    Post subject: Number of Records in a file
Reply with quote

Thank you Gerry
It worked.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Jan 15, 2010 2:08 pm    Post subject:
Reply with quote

Glad to hear it


Gerry
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us