View previous topic :: View next topic
|
Author |
Message |
samuel_Inba
New User
Joined: 03 Jan 2008 Posts: 53 Location: Chennai
|
|
|
|
Can anyone help me in finding and replacing a string in a VB file.
Recfm =71 and the string is of four chars. It may occur in any position of the file, which I should replace with another 4 char value.
Sam. |
|
Back to top |
|
|
samuel_Inba
New User
Joined: 03 Jan 2008 Posts: 53 Location: Chennai
|
|
|
|
i tried the below code, but it was able to change only 1 occurance. I changed the command to "f all" and "c all " .. but that doesnt help.. can sum one help pls...
Code: |
//STEP0005 EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
EDIT 'XXX.YYY.ZZZ' TEXT NONUM
TOP
F 'AAA'
C 'AAA' 'BBB'
END SAVE
/*
|
|
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Please try this,
Instead of,
Code: |
F 'AAA'
C 'AAA' 'BBB' |
|
|
Back to top |
|
|
samuel_Inba
New User
Joined: 03 Jan 2008 Posts: 53 Location: Chennai
|
|
|
|
Tried that too ... dint help... |
|
Back to top |
|
|
samuel_Inba
New User
Joined: 03 Jan 2008 Posts: 53 Location: Chennai
|
|
|
|
IF I dont use "F" before "C" ... even the 1 replacement is also not done...but if i use "F" and them "C" it replaces 1 occurance... tried "F all" and "C all" ..not use... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Search the forum for examples of how it should be done, as I have recently posted an ISPF edit macro in either the ISPF or REXX forums. |
|
Back to top |
|
|
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
Tested code. Very easy with fileaid
Code: |
//STEP0100 EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//DD01 DD DSN=your Input File,DISP=SHR
//DD01O DD DSN=Same Input File,DISP=SHR
//SYSIN DD *
$$DD01 UPDATE EDIT=(1,0,C'ABCD',C'XYZA')
/* |
Note: This is case sensitive. |
|
Back to top |
|
|
samuel_Inba
New User
Joined: 03 Jan 2008 Posts: 53 Location: Chennai
|
|
|
|
Thanks a lot shrivatsa . |
|
Back to top |
|
|
samuel_Inba
New User
Joined: 03 Jan 2008 Posts: 53 Location: Chennai
|
|
|
|
jus one more change i need to implement... can i hv a or within this file aid edit option...
I need to find a or b or c or d and replace it with e.
Even if any one if them is found i need to replace it with 'e'.
pls suggest.. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Somewhere along the way, I would've thought someone might take a minute and enter the HELP CHANGE command from within EDIT to find the proper syntax. This would've worked just fine:
Code: |
//STEP0005 EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
EDIT 'XXX.YYY.ZZZ' TEXT NONUM
TOP
C * 99999999 =AAA=BBB= ALL
END SAVE
/*
|
|
|
Back to top |
|
|
samuel_Inba
New User
Joined: 03 Jan 2008 Posts: 53 Location: Chennai
|
|
|
|
thx for the reply. It did work... |
|
Back to top |
|
|
samuel_Inba
New User
Joined: 03 Jan 2008 Posts: 53 Location: Chennai
|
|
|
|
I have another query,
can I have a AND statement in the below mentioned steps,
my requirement was changed,
I need replace all the occurance of the values say a b c and d with e.
if any one of them is present in the file it should be replaced... |
|
Back to top |
|
|
samuel_Inba
New User
Joined: 03 Jan 2008 Posts: 53 Location: Chennai
|
|
|
|
i used the below JCL and it worked....
//SYSIN DD *
$$DD01 UPDATE EDIT=(1,0,C'YYYY',C'////'),
EDIT=(1,0,C'XXXX',C'****')
|
|
Back to top |
|
|
shobvid
New User
Joined: 03 Apr 2008 Posts: 11 Location: India
|
|
|
|
Iam also interested in modifying multiple members in a PDS in one shot but Iam unable to locate the fileaid load module, we have only file manager, FMNMAIN. Please suggest. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Note that DFSORT now has a find and replace function called FINDREP, available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008). For complete details on the new FINDREP function and the other new functions available with PTF UK90013, see:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|