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

Syncsort version supporting FINDREP command


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

New User


Joined: 04 May 2012
Posts: 34
Location: Brazil

PostPosted: Tue Aug 09, 2016 6:54 pm
Reply with quote

Hi everyone!
I have 2 questions about Find and Replace commands in Syncsort:
1. what is the Syncsort version that supports FINDREP command?
2. Could we replace a value/string with a specified column in a record? I mean, in INOUT parameter we could use like this:
... FINDREP=(INOUT=(C'AB',25,2)) <= I know you know "25,2" is the position in record

Thanks in advance.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Aug 09, 2016 7:29 pm
Reply with quote

To Overlay a particular position you could just use OVERLAY with INREC
Back to top
View user's profile Send private message
juares castro

New User


Joined: 04 May 2012
Posts: 34
Location: Brazil

PostPosted: Tue Aug 09, 2016 8:16 pm
Reply with quote

Hi Pandora!
My question is about not knowing where the string is.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Aug 09, 2016 8:23 pm
Reply with quote

I am sorry , Can you explain with an example?
Back to top
View user's profile Send private message
Abid Hasan

New User


Joined: 25 Mar 2013
Posts: 88
Location: India

PostPosted: Tue Aug 09, 2016 8:36 pm
Reply with quote

Hello Juares,

For the first query, see if this link is of any help.

From the DFSORT manual, I donot see the positional replace functionality in FINDREP. I donot have SYNCSORT to confirm on this.
Though what you're trying to achieve can be done using PARSE/BUILD, as BUILD allows the user to play around with the data. Bit of code might be required to identify all the 'AB' combinations though.
Back to top
View user's profile Send private message
juares castro

New User


Joined: 04 May 2012
Posts: 34
Location: Brazil

PostPosted: Tue Aug 09, 2016 8:59 pm
Reply with quote

Hi Pandora!
I am trying do this:
Code:
//STEP10 EXEC PGM=SYNCSORT,REGION=7M       
//SORTIN   DD *                           
123AA999912BB                             
AA123888813CC                             
BB123456714DD                             
1AA23888813FF                             
//SORTOUT  DD ...                         
//SYSIN    DD *                           
 SORT FIELDS=COPY                         
 OUTREC IFTHEN=(WHEN=INIT,                 
         FINDREP=(INOUT=(C'AA',12,2)))     
//SYSOUT   DD SYSOUT=*                     
//*                                       
//                                         
                                           
GIVING THIS:                               
123BB999912BB                             
CC123888813CC                             
BB123456714DD                             
1FF23888813FF                             

Wherever we have "AA" change to content of position 12 with 2 bytes.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Tue Aug 09, 2016 10:40 pm
Reply with quote

Why on earth would you think that sufficiently common a requirement to have FINDREP support it?

Is your sample data representative? You're not going to turn around later and say "of course it can contain embedded blanks"?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3049
Location: NYC,USA

PostPosted: Tue Aug 09, 2016 11:46 pm
Reply with quote

See if you can twick this solution to fit your need.
Very much theoretical but try finding the offset of 'AA' using the shared link and then make a BUILD and replace the found offset with 12,2
Back to top
View user's profile Send private message
juares castro

New User


Joined: 04 May 2012
Posts: 34
Location: Brazil

PostPosted: Wed Aug 10, 2016 1:38 am
Reply with quote

Thanks Rohit!
Back to top
View user's profile Send private message
juares castro

New User


Joined: 04 May 2012
Posts: 34
Location: Brazil

PostPosted: Wed Aug 10, 2016 1:45 am
Reply with quote

Thanks Abid!
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 RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top