Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Record Count of two files in single SYSIN

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Record Count of two files in single SYSIN
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 Moderator


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

PostPosted: Fri Nov 10, 2006 10:05 pm    Post subject:
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    Post subject:
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    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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us