I have a flat file of FB 436 bytes out of which the amount field starts from 422nd byte and is stored as character format (15bytes).
I want to sum the amount based on Policy number (6 bytes char starting from 19th byte) and Effective date (10 bytes char starting from 39th byte).
I tried to make use of below mentioned SORT card but is abending because amount field is not numeric.
Input (putting the amount field alone from 422nd byte - 436th byte)
Output (Need to have the whole file with summed amount from 422nd byte)
For example if the first 2 records have same policy number and effective date, we should get it as
SORT FIELDS=(19,6,CH,A,39,10,CH,A)
SUM FIELDS=(422,15,CH)
Can anybody please help me in getting the Sort card corrected. I also want to see the resultant amount field in char format (for downloading to excel sheet)
Thanks Frank for the code
I have run the SOrt card and got the below mentioned error.
Code:
SYSIN :
SORT FIELDS=(19,6,CH,A,39,10,CH,A) 00150
OUTFIL REMOVECC,NODETAIL, 00180
SECTIONS=(19,6,SKIP=0L,39,10, 00190
TRAILER3=(1,421, 00191
*
422:TOT=(422,15,SFF,EDIT=(SIIIIIIIIIIT.TT),SIGNS=(,-)))) 00192
WER903I SYNCSORT 1.3.2.0 IS NOT LICENSED FOR SERIAL 6D972, TYPE 2097 711, LP
WER903I PRODUCT WILL STOP WORKING IN 26 DAYS UNLESS A VALID KEY IS INSTALLE
WER271A OUTFIL STATEMENT : NUMERIC FIELD ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
The job works fine with DFSORT. However, the WER messages indicate you're using Syncsort, not DFSORT. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
Please post questions on Syncsort in the JCL Forum, not in the DFSORT Forum.
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
Vinu - you have been told that you are using SYNCSORT so why do you keep posting in the DFSORT section? SYNCSORT nd DFSORT are NOT the same product and their control cards are not necessarily 100% compatible.
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
vinu78 wrote:
I have tried using ICETOOL but not getting an answer.
Did you mean - in the above Job, you've used PGM=ICETOOL instead of PGM=SORT?
You get, WER271A, NUMERIC FIELD ERROR, which means a numeric field has been improperly specified on the indicated SyncSort control statement. See, if the position you 've used in Trailer3 actually have the numeric fields in those positions...
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
Thanks for the info Frank.
I think I can see ICETOOL in my company.
Whether this requirement can be accomplished using ICETOOL ?
Since you have Syncsort installed, you would be using Syncsort's SYNCTOOL, not DFSORT's ICETOOL. But whether you're using PGM=SORT or PGM=ICETOOL the solution would essentially be the same.
The root of your problem is that DFSORT supports large trailer fields, but Syncsort does not. I'll leave it to others to tell you how to get around that Syncsort limitation.