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
 

 

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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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