Modifying only Trailer record count



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Modifying only Trailer record count

Postby ragsara » Thu Jul 05, 2012 8:14 pm

Hi All,

Really sorry i went through numerous posts but cannot fit in my requirement.

My requirement :
Input file doesn't come with correct number of detail records which is present as Trailer record count. Need to calculate the number of details records and replace it as Trailer record count.

Input file :

AB 001 2012-07-07 ------------ Header
AB 100 2012-07-07 ------------ Detail record
AB 200 2012-07-07 ------------ Detail record
AB 002 2012-07-07 0000000005 ---------- Trailer record

Output file :

AB 001 2012-07-07 ------------ Header
AB 100 2012-07-07 ------------ Detail record
AB 200 2012-07-07 ------------ Detail record
AB 002 2012-07-07 0000000002 ---------- Trailer record

Thanks in advance
ragsara
 
Posts: 23
Joined: Thu Mar 22, 2012 5:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Modifying only Trailer record count

Postby skolusu » Thu Jul 05, 2012 9:33 pm

ragasara,

Assuming that your trailer record can be identified with 'AB 002' in the first 6 bytes the following DFSORT JCL will give you the desired results
//STEP0100 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                         
AB 001 2012-07-07 ------------ HEADER                   
AB 100 2012-07-07 ------------ DETAIL RECORD             
AB 200 2012-07-07 ------------ DETAIL RECORD             
AB 002 2012-07-07 0000000005 ---------- TRAILER RECORD   
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                       
  OUTFIL IFTRAIL=(HD=YES,TRLID=(1,6,CH,EQ,C'AB 002'),   
  TRLUPD=(19:COUNT=(M11,LENGTH=10)))                     
//*                                                     


For complete details on the new functions for DFSORT and DFSORT's ICETOOL available with the Oct, 2010 PTF, see:

http://www.ibm.com/support/docview.wss? ... g3T7000242
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Modifying only Trailer record count

Postby ragsara » Thu Jul 05, 2012 9:56 pm

Hi skolusu,

I tried your solution but its shows me the below error

PARAMETER 'IFTRAIL' IS UNIDENTIFIED

I checked my DFSORT function level and its ICE201I H which is up to date i guess.

Please find my below code :

//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=F6435T.UHD.SELECT.A2120504.FB,DISP=SHR
//SORTOUT DD DSN=F6435T.UHD.SELECT.D2120503.FB,
// DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(150,150),RLSE),
// UNIT=SYSDA,DCB=(RECFM=FB,LRECL=2000,BLKSIZE=0)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL IFTRAIL=(HD=YES,TRLID=(63,3,EQ,C'001'),
TRLUPD=(236:COUNT=(M11,LENGTH=10)))
/*
ragsara
 
Posts: 23
Joined: Thu Mar 22, 2012 5:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Modifying only Trailer record count

Postby NicC » Thu Jul 05, 2012 10:12 pm

The real solution is to get the trailer created properly - not do this bodge (fix-up). One day the difference may be due to a real processing failure which you are now going to hide.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Modifying only Trailer record count

Postby skolusu » Thu Jul 05, 2012 10:17 pm

ragsara wrote:Hi skolusu,

I tried your solution but its shows me the below error

PARAMETER 'IFTRAIL' IS UNIDENTIFIED

I checked my DFSORT function level and its ICE201I H which is up to date i guess.


You need to show me the complete sysout. Did you run the JCL ? or did you just did a JCL CHECK? If so ignore the JCL CHECKER messages as they don't keep up with the latest features of DFSORT.
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Modifying only Trailer record count

Postby ragsara » Thu Jul 05, 2012 10:46 pm

Hi skolusu,

You are correct, i just ignored it and all went fine.

One small clarrificiation, How does it calculates the number of detail records. Because total record count was 4 including Header and Trailer. But it perfectly says detail record count as 2. I mean nowhere i can see this being used "COUNT-2" ... I may be silly but please forgive :)
ragsara
 
Posts: 23
Joined: Thu Mar 22, 2012 5:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Modifying only Trailer record count

Postby skolusu » Thu Jul 05, 2012 11:01 pm

ragsara wrote:Hi skolusu,

You are correct, i just ignored it and all went fine.

One small clarrificiation, How does it calculates the number of detail records. Because total record count was 4 including Header and Trailer. But it perfectly says detail record count as 2. I mean nowhere i can see this being used "COUNT-2" ... I may be silly but please forgive :)


Did you read the PDF documentation I posted in my original post? You need to understand why HD=yes is coded and the documentation explains everything in detail.
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Modifying only Trailer record count

Postby ragsara » Thu Jul 05, 2012 11:45 pm

Thanks skolusu for your kind help
ragsara
 
Posts: 23
Joined: Thu Mar 22, 2012 5:17 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post