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
 

 

Need Help update the trailer with the record count & Am

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Need Help update the trailer with the record count & Am
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    Post subject:
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    Post subject: Reply to: Need Help update the trailer with the record coun
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Wed Jan 30, 2013 3:01 pm    Post subject: Reply to: Need Help update the trailer with the record coun
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    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 -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
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 Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am


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