Here's a DFSORT job that will do what you asked for. You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use DFSORT's new SQZ function. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:
Also pls let me know why you have used INREC OVERLAY?
I used INREC OVERLAY because you just wanted to change the first 20 bytes without changing the rest of the record. OVERLAY=(1:1,20,SQZ...) only affects the first 20 bytes without affecting anything else. That's what you asked for.
In manual the usage given is
OUTREC FIELDS=(1,20,SQZ=(SHIFT=LEFT,MID=C',')) can I use this too?
Huh? That's valid syntax but it has nothing to do with your requirement. It will shift left and put a comma wherever it finds a blank between the first nonblank and last nonblank. It will also only give you the first 20 bytes of the input records in your output records. For your example, that would give you the following output which is not what you asked for:
whereas the INREC statement I showed you would give you the following output which is what you asked for:
Mark Spencer 1204505678AB546776 SWS
Peter Shildon 1204505678AB546776 SWS
Dirk M Tyle 5678490022CC695486 MFT
You have to use the right control statements to get what you want.
would give you the following 20-byte output records:
Dirk M Tyle
If that's what you want for output instead of the output you said you wanted originally (with all of the fields), then you can use that syntax to get it. If you want the output you originally said you wanted, then you need to use the syntax I gave you.
//***?$ TO DELETE ALL TEMP FILES
My yellow card with the EBCDIC codes and Appendix D of "DFSORT Application Programming Guide" both show 4A as the cent sign and 5B as the dollar sign. I believe these are the standard EBCDIC codes. You're probably displaying these values as your local currency symbols by way of a different code page. Maybe somebody who knows more about such things can explain it more clearly.