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

Need Help update the trailer with the record count & Am


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

New User


Joined: 16 Aug 2007
Posts: 27
Location: Hyderabad

PostPosted: Tue Jan 29, 2013 4:59 pm
Reply with quote

Input File:
Code:
HDRXXXXXXXX
ABTESTNAME000020000
ABTESTNAME000020000
ABTESTNAME000020000
BCTESTNAME000020000
BCTESTNAME000020000
BCTESTNAME000020000
BCTESTNAME000020000
CDTESTNAME000020000
CDTESTNAME000020000
CDTESTNAME000020000
T1AB0000000000000000000BC0000000000000000000CD0000000000000000000 TL00000000000000000000000000


Output need individual detail record count and amounts total also need grand total record count and Grand total amount in the Trailer record.

Input file detailed records are ‘AB’,’BC’,’CD’ and their respective deta
ils record counts are 3,4,3 and their Amount positions 11 to 19 total (length=7) ,
‘AB’ records total Amount = 60000 (20000+10000+30000),
‘BC’ records total Amount = 80000 (10000+20000+40000+10000),
‘CD’ records total Amount = 90000 (20000+10000+60000) and
Grand total record count (3 + 4 +3) and Grand total amount 230000(60000+80000+90000).

Trailer Record Format
Code:
01   TLR-REC
       05   FILLER  PIC X(12).
       05   T1-CODE  PIC X(2) VALUE ‘T1’.
       05   T1-DATA  OCCURS 15 TIMES.
            10  T1-INFO.
                15 T1-CODE     PIC X(2).
                15 T1-COUNT    PIC X(7) VALUE ZEROES.
                15 T1-AMT      PIC X(12) VALUE ZEROES.
        05 TL-CODE    PIC X(2) VALUE ‘TL’.
        05 TL-GRAND-COUNT    PIC X(12) VALUE ZEROES.
        05 TL-GRAND-AMOUNT   PIC X(14) VALUE ZEROES.
        05 FILLER PIC X(263).


Expected Output:
Code:
HDRXXXXXXXX
ABTESTNAME000020000
ABTESTNAME000010000
ABTESTNAME000030000
BCTESTNAME000010000
BCTESTNAME000020000
BCTESTNAME000040000
BCTESTNAME000010000
CDTESTNAME000020000
CDTESTNAME000010000
CDTESTNAME000060000
TLRAB0000003000000060000BC0000004000000080000CD0000000000000090000TL00000000001000000000230000

I tried with TRLUPD option it is working for one record(AB) need solution for other records(BC,CD) and grand total and Amount

Code:
000010 //STEP010  EXEC PGM=ICETOOL                                   
000011 //TOOLMSG  DD SYSOUT=*                                       
000012 //DFSMSG   DD SYSOUT=*                                       
000013 //SORTIN   DD DISP=SHR,DSN=TEST.INPUT               
000014 //SORTOUT  DD DSN=TEST.OUTPUT,                       
000015 //   DISP=(NEW,CATLG,DELETE),                           
000016 //   UNIT=SYSDA,DCB=*.SORTIN,SPACE=(CYL,(10,5),RLSE)   
000017 //SYSOUT   DD SYSOUT=*                                       
000018 //TOOLIN   DD *                                               
000019   SORT FROM(SORTIN) TO(SORTOUT) USING(TST1)                   
000020 /*                                                           
000021 //TST1CNTL   DD *                                             
000022   OPTION COPY                                                 
000023   OUTFIL FNAMES=SORTOUT,                                     
000024   INCLUDE=(1,2,CH,EQ,C'AB'),                                 
000025     IFTRAIL=(HD=YES,TRLID=(1,2,CH,EQ,C'T1'),                 
000026     TRLUPD=(17:COUNT=(M11,LENGTH=7)))                         
000027 /*           


Thanks In advance for your help, let me know if need any other details.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Jan 29, 2013 11:33 pm
Reply with quote

vvgoud,

*sigh* It is even here?? I just responded to your pvt email that you sent me.

Your details are a mess.

1. Your input does not match the expected output. Your sample input shows the amounts to be 20000 on all records but on the output you show different amounts for each record. What is the formula for the amounts to be changed to a different value?
2. You mention that the Amounts positions 11 to 19 total length=7 , but position 11 thru 19 will result in 9 bytes and not 7 bytes.
3. Your COBOL layout shows that Counts/Amount totals are an array of 15 occurrences. So do you need to calculate the record count and sum for all the 15 or just the 3 values you show here?
4. What version of DFSORT are you running? Please run the following job and show me the complete sysout which will help us determine the level of DFSORT your shop has
Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*   
//SORTIN   DD *         
//SORTOUT  DD SYSOUT=*   
//SYSIN    DD *         
  SORT FIELDS=COPY       
//*
Back to top
View user's profile Send private message
vvgoud

New User


Joined: 16 Aug 2007
Posts: 27
Location: Hyderabad

PostPosted: Wed Jan 30, 2013 2:58 pm
Reply with quote

Hi Kolusu, Thanks so much for your quick reply, i sent reply to your email with updated details, please look and let me know if you need details.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jan 30, 2013 3:01 pm
Reply with quote

since the discussion was taken OFFLINE the topic will be locked and delete shortly
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 FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top