|
View previous topic :: View next topic
|
| Author |
Message |
Kevin Lindsley
New User
Joined: 02 Jun 2016 Posts: 5 Location: us
|
|
|
|
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:
| Code: |
10415728001010111223333 2015042820140101201401010
10415728001010444556666 2015042820140101201401010
|
I need the output as:
| Code: |
10415728001010XXXXXXXXX 2015042820140101201401010
10415728001010XXXXXXXXX 2015042820140101201401010
|
The input data could also have the typical dashes I would need to maintain. Input data below:
| Code: |
10415728001010111-22-3333 2015042820140101201401010
10415728001010444-55-6666 2015042820140101201401010
|
I need the output as:
| Code: |
10415728001010XXX-XX-XXXX 2015042820140101201401010
10415728001010XXX-XX-XXXX 2015042820140101201401010
|
It seems so basic but I'm not finding how to incorporate it in with my existing OUTREC processing. Thanks. |
|
| Back to top |
|
 |
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
What is your other outrec processing?
It could be as simple as Overlaying XXX-XX-XXXX if you find a '-' at a particular column Or Overlay 'XXXXXXXXX' if don't find a '-'.
. |
|
| Back to top |
|
 |
Kevin Lindsley
New User
Joined: 02 Jun 2016 Posts: 5 Location: us
|
|
|
|
| Code: |
OPTION COPY
OMIT COND=(5,1,CH,EQ,C'9')
OUTREC FIELDS=(1,41,42,6,Y2W,48,6,Y2W,54,6,Y2W,60,47,107,3,PD,
EDIT=(TTTTTS),SIGNS=(,,+,-),110,134,244,5,PD,
EDIT=(TTTTTTTTTS),SIGNS=(,,+,-),249,6,PD,
EDIT=(TTTTTTTTTTTS),SIGNS=(,,+,-),255,11,
266,6,Y2W,272,111)
|
|
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 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. |
|
| Back to top |
|
 |
Kevin Lindsley
New User
Joined: 02 Jun 2016 Posts: 5 Location: us
|
|
|
|
| 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. |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
Kevin,
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. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| Well, there's eight pages of examples in this part of the forum, more in the JCL part of the forum and many, many, examples in the DFSORT part of the forum which will largely work. |
|
| Back to top |
|
 |
Kevin Lindsley
New User
Joined: 02 Jun 2016 Posts: 5 Location: us
|
|
|
|
| Thanks, I'll take a look. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|