MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Replace strings containing '

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
info_seeker
Beginner


Joined: 31 Jan 2005
Posts: 27
Topics: 9

PostPosted: Wed Jan 18, 2006 3:33 pm    Post subject: Replace strings containing ' Reply with quote

Hi,

I am trying to replace the string AMP=(AMORG,'BUFND=10','BUFNI=3')
by AMP=('ACCBIAS=SYSTEM'). I checked all the previous postings, but, fileaid and syncsort doesn't accept ' as a valid character to be replaced. Help much appreciated!!!
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Jan 18, 2006 3:50 pm    Post subject: Reply with quote

info_seeker,

use double quotes(") to treat single quote as a part of change key. Also use editall function as the target string to be replaced is shorter than the original string.

Code:

//STEP0100 EXEC PGM=FILEAID,REGION=0M                         
//SYSPRINT DD SYSOUT=*                                         
//DD01     DD *                                               
AMP=(AMORG,'BUFND=10','BUFNI=3')                               
FIELD1:XXXXXKOLUSU                                             
FIELD2:XXXXXFRANK                                             
//DD01O    DD SYSOUT=*                                         
//SYSIN    DD *                                               
$$DD01 COPY EDITALL=(01,00,C"AMP=(AMORG,'BUFND=10','BUFNI=3')",
                     C"AMP=('ACCBIAS=SYSTEM')")               
/*                                                             


will produce this
Code:

AMP=('ACCBIAS=SYSTEM')
FIELD1:XXXXXKOLUSU     
FIELD2:XXXXXFRANK     


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
German Castillo
Beginner


Joined: 23 Dec 2005
Posts: 83
Topics: 2
Location: Caracas, Venezuela

PostPosted: Wed Jan 18, 2006 3:51 pm    Post subject: Reply with quote

Hello info_seeker,

Rexx Macros are used to do so

Code in a rexx Script like:

Code:

/* Main Rexx */
dsname = 'My.Dataset'
ADDRESS ISPEXEC ,                                             
  "EDIT DATASET('"dsname")') MACRO(Replace)"
if rc > 4 Then Say 'Error in dataset edit'


And your replace macro should look like:
Code:

ADDRESS ISREDIT
'MACRO'

'C "AMP=(AMORG,''BUFND=10'',''BUFNI=3'')" ,
"AMP=(''ACCBIAS=SYSTEM'')" ALL'         

'BUILTIN SAVE'
'BUILTIN CANCEL'
RETURN         


Just be sure to use a double quote where appropiated
_________________
Best wishes,

German Castillo
Back to top
View user's profile Send private message
info_seeker
Beginner


Joined: 31 Jan 2005
Posts: 27
Topics: 9

PostPosted: Wed Jan 18, 2006 5:22 pm    Post subject: Reply with quote

Hi Kolusu,

The solution worked. Thanks a lot for it!!


Cheers!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group