View previous topic :: View next topic |
Author |
Message |
srini_igsi Beginner
Joined: 12 May 2006 Posts: 41 Topics: 16 Location: Mumbai
|
Posted: Thu Nov 02, 2006 7:13 am Post subject: Reg the amount fields which are in Overpunch format |
|
|
Hi,
We receive a file from the client with the amount fields in 'Overpunch' fomat on it. The file has a HDR, Multiple DTL(s) and a TRL record on it. For all the DTL records, an amount field which starts at 70th position and is of length 11 chars have to be summed up and this accumulated amount should be written to an out file with only one record. Here the question is about handling the amounts which are in 'Overpunch' format in DF Sort.
Ex:
0000001770A
0000028268D
0000003218A
0000000173F
The actual 'A' value is +1 - so the exact value will be '+00000017701' ... D - +4 .... etc.
Can somebody help me out to sum up these values using DF Sort. _________________ Thanks,
-Srini |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Nov 02, 2006 7:48 am Post subject: |
|
|
srini_igsi,
you need to use the option ZDPRINT .I assumed that your DTL records are identified by DTL in the first 3 bytes.
Try this
Code: |
//SYSIN DD *
INCLUDE COND=(1,3,CH,EQ,C'DTL')
OPTION ZDPRINT
SORT FIELDS=(1,3,CH,A)
SUM FIELDS=(70,11,ZD)
/*
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
srini_igsi Beginner
Joined: 12 May 2006 Posts: 41 Topics: 16 Location: Mumbai
|
Posted: Fri Nov 03, 2006 3:19 am Post subject: |
|
|
Hi,
Thanks, it's working fine. Could you pl explain me a little bit abt OPTION ZDPRINT. _________________ Thanks,
-Srini |
|
Back to top |
|
|
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Fri Nov 03, 2006 11:33 am Post subject: |
|
|
ZDPRINT tells DFSORT to use an F sign rather than a C sign for summed positive ZD fields. So a summed value of 123 would be X'F1F2F3' which prints/displays as '123' rather than X'F1F2C3' which prints/displays as '12C'. Thus, with ZDPRINT, the positive summed ZD values are printable/displayable. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
|
srini_igsi Beginner
Joined: 12 May 2006 Posts: 41 Topics: 16 Location: Mumbai
|
Posted: Mon Nov 20, 2006 8:34 am Post subject: |
|
|
The same 'ZDPRINT' can also convert the negative overpunched chars like for the positive overpunched ... right?
Pl correct me if i am wrong. _________________ Thanks,
-Srini |
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Mon Nov 20, 2006 11:30 am Post subject: |
|
|
Quote: | The same 'ZDPRINT' can also convert the negative overpunched chars like for the positive overpunched ... right?
Pl correct me if i am wrong. |
No. ZDPRINT only changes positive values (C sign to F sign) to make them printable. It does not change negative values (D sign) - if it changed a D sign to an F sign, the value would be printable but would no longer be negative.
Tell us exactly what it is you want the output values to look like for positive and negative input values and we'll show you how to do it. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
|
|
|