IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Overlaying one set of charater values with another


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Kevin Lindsley

New User


Joined: 02 Jun 2016
Posts: 5
Location: us

PostPosted: Sat Nov 05, 2016 3:21 am
Reply with quote

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
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Sat Nov 05, 2016 3:29 am
Reply with quote

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
View user's profile Send private message
Kevin Lindsley

New User


Joined: 02 Jun 2016
Posts: 5
Location: us

PostPosted: Sat Nov 05, 2016 4:06 am
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7310
Location: Inside the Matrix

PostPosted: Sat Nov 05, 2016 4:27 am
Reply with quote

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
View user's profile Send private message
Kevin Lindsley

New User


Joined: 02 Jun 2016
Posts: 5
Location: us

PostPosted: Sat Nov 05, 2016 5:12 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sat Nov 05, 2016 5:33 am
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7310
Location: Inside the Matrix

PostPosted: Sat Nov 05, 2016 5:34 am
Reply with quote

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
View user's profile Send private message
Kevin Lindsley

New User


Joined: 02 Jun 2016
Posts: 5
Location: us

PostPosted: Tue Nov 08, 2016 6:33 am
Reply with quote

Thanks, I'll take a look.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Trim values of parameters in JCL JCL & VSAM 2
No new posts a copybook getting improper values in... COBOL Programming 7
No new posts JDBC Driver -Default Values DB2 1
No new posts Not able to view the values of variab... CA Products 1
No new posts ADD/ SUB Values DFSORT/ICETOOL 7
Search our Forums:

Back to Top