Joined: 14 Jan 2008 Posts: 2504 Location: Atlanta, Georgia, USA
Are you sure you want SORT to convert to packed-decimal (neutral), which has a sign-nibble of 'F' or to packed-decimal (signed), which has a sign-nibble of 'C'?
Based upon the COMP-3 picture-clause you've posted, you want packed-decimal neutral.
Are you sure about this?
If for whatever reason, a program later down the line, whose picture-clause is S9(03) COMP-3 issues (for whatever reason) a NUMERIC check against this data, it will fail, due to the 'F' sign-nibble. This is also vice-versa.
Equivalent of 111 in comp-3 format
PIC 9(3) is a 3-byte ZD value. PIC 9(3) COMP-3 is a 2-byte PD value. Assuming the field starts in position 1, you could use these DFSORT control statements to do the conversion:
That will give you a C for the positive PD sign. If you want an F for the positive PD sign, use TO=PDF. If you want a length of 3 for the output field, use LENGTH=3.
If you want something else, be more specific about what you want.
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from: