I have a file where in there are a number of detail records(identified by '20' in the first two bytes) and a single trailer record(identified by '30' in the first two bytes). In the trailer record, I need to populate the bytes 3-7 (at position 3 of length 5 bytes) in the packed decimal format S9(9) COMP-3 that would contain the total number of type '20' records.

How can we do this using SORT ? I do not want to use ICEMAN/ICETOOL/SYNCSORT.

Hmmm ... what exactly do you mean by "SORT"? "ICEMAN" is an alias for DFSORT, Syncsort and CA-Sort. PGM=ICEMAN is the same as PGM=SORT. DFSORT is certainly not Syncsort, but it is ICEMAN. ICETOOL is part of DFSORT.

I suspect that most of the people posting topics on these forums have "programming" somewhere in their job description. How is then "ruling out" code as an alternative justified (or even tolerated)?

While i'm very much in favor of using our tools and their special features, i'm not in favor of someone handing out assignments with "Ok, Joe Programmer - here's a coding task that you are not allowed to write code for". How silly!

Who makes such "rules"?
I suspect that most of the people posting topics on these forums have "programming" somewhere in their job description. How is then "ruling out" code as an alternative justified (or even tolerated)?

Its the requirements that drive such rules. Even Iam a programmer but have to follow the requirements that Iam provided with.

My intent of posting the query was to take some help from experts and not to start a chain of debates and fiery replies.

Please note that you are using Syncsort. You can tell that from the "WER" messages. At many sites, executing ICEMAN actually invokes Syncsort, not the IBM product. That appears to be what is happening with your job.

Frank's solution is for DFSORT. The control statements for both sorts are not the same.

The job runs fine with DFSORT. As Dick pointed out, 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.

If you or anyone else on this board would like some documents prepared by the DFSORT Team that describe what we see as the advantages of DFSORT over Syncsort, as well as considersations for migrating from Syncsort to DFSORT, send me an e-mail offline (yaeger@us.ibm.com). Please put "DFSORT" somewere in your Subject line to catch my attention.