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

Number of Records in a file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1249
Location: Richfield, MN, USA

PostPosted: Fri Jan 15, 2010 10:06 am
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: 1702
Location: Australia

PostPosted: Fri Jan 15, 2010 10:08 am
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
Reply with quote

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

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

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

this is a fileaid thread:
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: 1249
Location: Richfield, MN, USA

PostPosted: Fri Jan 15, 2010 10:40 am
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
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
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
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Jan 15, 2010 1:39 pm
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: 1702
Location: Australia

PostPosted: Fri Jan 15, 2010 2:00 pm
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
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: 1702
Location: Australia

PostPosted: Fri Jan 15, 2010 2:08 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top