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

Record Count of two files in single SYSIN


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

Active User


Joined: 01 Aug 2005
Posts: 105
Location: Somerset, NJ

PostPosted: Fri Nov 10, 2006 1:06 pm
Reply with quote

Hi,

I need to add a Trailer record in a flat file in the following format:

Code:
ZZZZZZZZ<Rec. cnt of File1 (8digits)><Rec. cnt of File2 (6digits)>

where 'ZZZZZZZZ' is a hard coded value.

Is this possible using ICEMAN/DFSORT with just a single SYSIN?

I've been using the following code to get the record count of one file:

Code:
//STEP001  EXEC PGM=ICEMAN                                   
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD DISP=SHR,DSN=i/p file   
//SORTOUT  DD DSN=o/p file,                 
//            DISP=(NEW,CATLG,CATLG),                       
//            DCB=(RECFM=FB,LRECL=80),SPACE=(CYL,(1,1),RLSE)
//SYSIN    DD *                                             
  OPTION COPY                                               
  OUTFIL REMOVECC,NODETAIL,                                 
  TRAILER1=(1:'ZZZZZZZZ',9:COUNT=(M11,LENGTH=8))             
/*   


Thanks in advance,
Twissi.
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 Nov 10, 2006 10:05 pm
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//STEP000  EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DISP=SHR,DSN=i/p file2
//SYM DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
* Create a DFSORT symbol with the count for file2 as:
* CT2,'nnnnnnnn'
  OUTFIL FNAMES=SYM,REMOVECC,NODETAIL,OUTREC=(80X),
    TRAILER1=('CT2,''',COUNT=(M11,LENGTH=8),'''')
/*
//STEP001  EXEC PGM=ICEMAN
//SYSOUT   DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN   DD DISP=SHR,DSN=i/p file1
//SORTOUT  DD DSN=o/p file,
//            DISP=(NEW,CATLG,CATLG),
//            DCB=(RECFM=FB,LRECL=80),SPACE=(CYL,(1,1),RLSE)
//SYSIN    DD *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
* Use CT2 in the trailer record.
  TRAILER1=(1:'ZZZZZZZZ',9:COUNT=(M11,LENGTH=8),17:CT2)
/*
Back to top
View user's profile Send private message
twissi

Active User


Joined: 01 Aug 2005
Posts: 105
Location: Somerset, NJ

PostPosted: Tue Nov 14, 2006 9:44 am
Reply with quote

Frank,

Thanks a ton, it really did work for me!

Regards, Twissi.
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 To get the count of rows for every 1 ... DB2 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top