Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Overlaying one set of charater values with another

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
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    Post subject: Overlaying one set of charater values with another
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: 371
Location: USA

PostPosted: Sat Nov 05, 2016 3:29 am    Post subject: Reply to: Overlaying one set of charater values with another
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    Post subject: This is one of my typical OUTRECs:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Sat Nov 05, 2016 4:27 am    Post subject: Reply to: Overlaying one set of charater values with another
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    Post subject:
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: 2276
Location: @my desk

PostPosted: Sat Nov 05, 2016 5:33 am    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Sat Nov 05, 2016 5:34 am    Post subject: Reply to: Overlaying one set of charater values with another
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    Post subject: Thanks, I'll take a look.
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us