I am using basic OUTREC FIELDS=( to accomplish various data manipulations within a file. I now need to add another manipulation where I would be overlaying the SSN field with X's for their values. Input data below:
Joined: 09 Mar 2011 Posts: 7310 Location: Inside the Matrix
Don't use FIELDS, use BUILD. FIELDS means different things in different places (and in one place OUTREC means the same as the use of FIELDS on INREC and OUTREC - see how confusing?). BUILD only means BUILD.
I prefer to use INREC, which operates before a SORT, rather than OUTREC, which operates after a SORT. With no SORT, INREC just seems more natural. As long as you know why you've chosen OUTREC, it is OK, though.
Use IFTHEN=(WHEN=INIT for your BUILD, IFTHEN=(WHEN=(logicalexpression) to identify the "-", and do one OVERLAY, and IFTHEN=(WHEN=NONE) (effectively an ELSE or "WHEN OTHER") to fully clobber the numbers.
Thanks Bill. Your INREC and BUILD comments make sense and worked fine (as you would have expected) when I swapped them into my existing code. Do you know of a resource that provides tons of working sample code for the different SYNCSORT operations. I'm new to SYNCSORT and am having a hard time putting the pieces together from the SyncSort for z/OS Release 1.3 Programmer's Guide. I'm still trying to picture the code structure for the IFTHEN and OVERLAY within my existing code.
Good to know that you were able to successfully incorporate Bill's suggestions on INREC/BUILD. Syncsort manual has IFTHEN OVERLAY examples. Feel free to try out something and get back if something bites. Someone would be here to assist you.