Scenario: Am creating two outputs from a single sort in. The input has a control record and I want a control record to be created in both the sort outs. When I use E35 to execute my routine, its not creating a new control in the output.
But the same routine in E35 is creating a control record as expected when there is ONE sortout.
My original file has 12 amount fields in it. Control record has record count and SUM of Amount (irrespective of the values of other fields) in it.
Ex:
rec1abc 100
rec2cde 200
rec3efg 100
rec4ghi 200
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You're not explaining clearly what you want to do or what is happening exactly, so it's difficult to help you. Your original question was about exits in ICETOOL, but all you show is DFSORT control statements, so I don't know what, if any, ICETOOL operator you're using.
You haven't explained clearly what you're trying to do. I don't know what your E35 exit does or if you even need it.
I don't know if you're using OUTFIL statements in one case and no OUTFIL statements in the other case, or if you're using OUTFIL statements in both cases.
If you explain things more clearly, I can probably help you. Showing your complete job, messages, input and expected output, etc would help.
Currently I have been using SORT and exit E35 to create a control record in the output file. I have a batchcob(CRCNTL) written to create a control record with record count and sum of fields.
Input file:
rec1abc 100 220
rec2cde 200 120
rec3abc 100 200
rec4abc 100 456
rec5ghi 200 345
000005 700 1341
When i use the below sysin, my exit does create the control record as shown below and that is what is expected.
SORT FIELDS=(5,3,CH,A),
SIZE=E99999999,DYNALLOC=(SYSDA,32)
MODS E35=(crcntl,100,MODLIB,N)
INCLUDE COND=(5,3,CH,EQ,C'ABC')
When i try creating two output files from a sortin, control record is not getting created. I have used the below code. (I believe the exit routine is not getting executed in the below code)
000003 300 876 - this control is not getting created in the final output file1
Outfile2:
rec2cde 200 120
rec5ghi 200 345
000002 400 465 - this control is not getting created in the final output file2
Since i did not get the expected result using SORT, I thought of trying with ICETOOL. Is there any possibilitis of creating the control record as shown above using SORT or ICETOOL. (My original file has around 25 such fields to be summed up in the control record)
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
I really don't think that you need an exit for this, generating totals in a trailer record is a basic sort function and doing it for two outputs is as simple as doing it for one.