How to have multiple counts for a single trailer

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
aj kumar
Member
Posts: 2
Joined: Fri Jun 05, 2015 9:52 am

How to have multiple counts for a single trailer

Post by aj kumar » Fri Jun 05, 2015 10:29 am

Hi All,

This is my data:

Code: Select all

0HDR123456
1DTLA123456A
1DTLA234567A
1DTLA345678A
1DTLA234567B
1DTLB123456A
1DTLB234567A
1DTLB345678A
1DTLB234567B
1DTLC123456A
1DTLC234567A
1DTLC345678A
1DTLC234567B
9TLR00012
If I wanted to have the trailer to be like below what should i do ?

Code: Select all

9TLR000030000400003000040000300004
it should have the counts as DTLA with char'A' at 12th position, complete DTLA , DTLB with char'A' at 12th position, complete DTLB,DTLC with char'A' at 12th position, complete DTLC.

Can anyone please let me know if it is possible with a example or how to do it with SORT ?

I have come across this kind of code

Code: Select all

//SYSIN    DD *                                          
  SORT FIELDS=COPY                                       
  OUTFIL IFTRAIL=(HD=YES,TRLID=(1,6,CH,EQ,C'AB 002'),    
  TRLUPD=(19:COUNT=(M11,LENGTH=10)))                     
//*   
but not sure on how to find for multiple counts based on a condition.
Thanks & Regards
AJ

aj kumar
Member
Posts: 2
Joined: Fri Jun 05, 2015 9:52 am

Post by aj kumar » Wed Jun 10, 2015 8:16 am

Hi all,

Any idea on this? Is the question clear in the above post? Let me know if it's not clear or please direct me if this has been discussed earlier. Thanks in advance
Thanks & Regards
AJ

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Wed Jun 10, 2015 8:54 pm

You temporarily extend your records to have a count field for the each of the various things you want to count.

Then use the TOT/TOTAL on TRLUPD for each of those fields, and BUILD to drop them off.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others