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

counting records from a no. of files and put in one o/p file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vampire

New User


Joined: 12 Oct 2009
Posts: 15
Location: Pune

PostPosted: Thu Oct 15, 2009 5:50 pm
Reply with quote

Hi ,

Is there any way in which we can count the number of records in more than one files and then put those counts in one output file?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Oct 15, 2009 9:09 pm
Reply with quote

Please show an example of what you want the output file to look like.

Also, give the RECFM and LRECL of the input files.
Back to top
View user's profile Send private message
vampire

New User


Joined: 12 Oct 2009
Posts: 15
Location: Pune

PostPosted: Fri Oct 16, 2009 9:45 am
Reply with quote

I/P File1:
rec1
rec2
rec3
rec4

I/P File2:
rec1
rec2

O/P File:
Record count file1:4
Record count file2:2

RECFM is FB and LRECL is 25004.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Oct 16, 2009 10:17 am
Reply with quote

Hi,

this is one way of achieving what you are after
Code:
//STEP0001 EXEC PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*                                   
//DFSMSG   DD SYSOUT=*                                   
//IN01     DD DSN=INPUT-FILE1,DISP=SHR                   
//IN02     DD DSN=INPUT-FILE2,DISP=SHR                   
//COUNT    DD DSN=OUTPUT-FILE,DISP=(MOD,CATLG,DELETE),   
//            UNIT=SYSDA,SPACE=(TRK,(10,5),RLSE)         
//TOOLIN   DD *                                           
 COPY FROM(IN01) USING(CTL1)                   
 COPY FROM(IN02) USING(CTL2)                   
//CTL1CNTL DD *                                           
  OUTFIL FNAMES=COUNT,                                   
   REMOVECC,NODETAIL,                                     
   TRAILER1=('RECORD COUNT FILE 1:',                       
            COUNT)
/*                                   
//CTL2CNTL DD *                           
  OUTFIL FNAMES=COUNT,                   
   REMOVECC,NODETAIL,                     
   TRAILER1=('RECORD COUNT FILE 2:',       
            COUNT)   
/*               


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

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Oct 16, 2009 8:58 pm
Reply with quote

Here's another way to do it with DFSORT's ICETOOL:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN01     DD DSN=...  input file1
//IN02     DD DSN=...  input file2
...
//OUT    DD DISP=MOD,DSN=...  MOD output file
//TOOLIN DD *
COUNT FROM(IN01) WRITE(OUT) EDCOUNT(U08) -
  TEXT('Record count file1: ')
COUNT FROM(IN02) WRITE(OUT) EDCOUNT(U08) -
  TEXT('Record count file2: ')
...
/*
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 FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
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
Search our Forums:

Back to Top