How I can create a total&count using DFSORT?



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

How I can create a total&count using DFSORT?

Postby Claudg » Wed Oct 15, 2014 2:29 pm

I need to create just one report where the total amount and count should be divide in CRE and DEB. The amount to sum is the position. Could you please help to sortout it? thanks.

The input file is:
0123456789012345678901234
01071020140000000003700DR
01071020140000000005000DR
01071020140000000002000CR
01071020140000000005000DR
01071020140000000001700CR
The report that we need to have is:
REPRT01 INCOMING PAYMENTS
0015 2014/10/06-12:34 SPP01 PAYMENTS INCOMING FILE - 01

RECORD COUNT OF RECORDS - 3 2
TOTAL AMOUNT OF RECORDS - 137,00 - 37,00

Detail position 01,02
Position amount 10,13
CR/DR position 23,02

Thanks fro your help
Claudg
 
Posts: 3
Joined: Wed Oct 15, 2014 2:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How I can create a total&count using DFSORT?

Postby BillyBoyo » Wed Oct 15, 2014 3:07 pm

You'll need OUTFIL's reporting functions or to use ICETOOL's DISPLAY operator.

OUTFIL has TOT/TOTAL and COUNT. Should give you what you want.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How I can create a total&count using DFSORT?

Postby Claudg » Wed Oct 15, 2014 4:02 pm

Hi BillyBoyo, thanks for your reply.
I've been used the code below, but my problem is how I know to sum CRE or DEB? The amount is the same position and then I'm not able to get the proper report.
Could please give some code examples in order to help me? Thanks
INCLUDE COND=(001,002,CH,EQ,C'01')       -----> DETAIL RECORDS ONLY
OPTION COPY                                                       
OUTFIL FNAMES=SORTOUT,REMOVECC,NODETAIL,                           
  HEADER1=(C'REPRT01',                                           
           55X,C'INCOMING PAYMENTS FILE 01',                     
           38X,                                                   
           C'DATE - ',                                             
           C'2014/10/06'), 
 TRAILER1=(5/,C'RECORD COUNT OF DPM DIRECT DEBIT COLLECTIONS   ',
           C'IN SPLITTER         - ',                             
           8X,                                                     
           COUNT=(M10,LENGTH=10),59X,                             
           3/,                                                     
        3/,C'TOTAL AMOUNT OF DPM DIRECT DEBIT COLLECTIONS   ',     
           C'IN SPLITTER         - ',                             
           TOTAL=(119,013,ZD,M19,LENGTH=18),59X)


Code'd
Claudg
 
Posts: 3
Joined: Wed Oct 15, 2014 2:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How I can create a total&count using DFSORT?

Postby BillyBoyo » Wed Oct 15, 2014 5:57 pm

You'll need to use IFTHEN=(WHEN=(logical-expression) to identify those which are "negative" from the text and use +0,SUB on the actual value to make it negative for those, then the TOTAL will work.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How I can create a total&count using DFSORT?

Postby Claudg » Wed Oct 15, 2014 7:15 pm

Hi BilyBoyo,

is there any chance to sent me code? Thanks.
this is because I don't have enough knowledge about dfsort and special with IFTHEN=(WHEN=(logical-expression).
I mean where in the current code I have to put this instruction?
Thanks once more time
Claudg
 
Posts: 3
Joined: Wed Oct 15, 2014 2:07 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post