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
 

 

Syncsort version supporting FINDREP command

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
juares castro

New User


Joined: 04 May 2012
Posts: 18
Location: Brazil

PostPosted: Tue Aug 09, 2016 6:54 pm    Post subject: Syncsort version supporting FINDREP command
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

Moderator


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

PostPosted: Tue Aug 09, 2016 7:29 pm    Post subject:
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: 18
Location: Brazil

PostPosted: Tue Aug 09, 2016 8:16 pm    Post subject:
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

Moderator


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

PostPosted: Tue Aug 09, 2016 8:23 pm    Post subject:
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: 65
Location: India

PostPosted: Tue Aug 09, 2016 8:36 pm    Post subject:
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: 18
Location: Brazil

PostPosted: Tue Aug 09, 2016 8:59 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Tue Aug 09, 2016 10:40 pm    Post subject: Reply to: Syncsort version supporting FINDREP command
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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Tue Aug 09, 2016 11:46 pm    Post subject:
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: 18
Location: Brazil

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

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

New User


Joined: 04 May 2012
Posts: 18
Location: Brazil

PostPosted: Wed Aug 10, 2016 1:45 am    Post subject:
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    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 syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am


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