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
 

 

Finding and replacing a string in a VB file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
samuel_Inba

New User


Joined: 03 Jan 2008
Posts: 53
Location: Chennai

PostPosted: Fri Mar 28, 2008 3:11 pm    Post subject: Finding and replacing a string in a VB file
Reply with quote

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
View user's profile Send private message

samuel_Inba

New User


Joined: 03 Jan 2008
Posts: 53
Location: Chennai

PostPosted: Fri Mar 28, 2008 4:25 pm    Post subject:
Reply with quote

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                                                   
/*                                                         


icon_sad.gif
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 785
Location: Chennai, India

PostPosted: Fri Mar 28, 2008 4:34 pm    Post subject:
Reply with quote

Please try this,
Code:
C ALL 'AAA' 'BBB'

Instead of,
Code:
F  'AAA'                                               
C  'AAA' 'BBB'
Back to top
View user's profile Send private message
samuel_Inba

New User


Joined: 03 Jan 2008
Posts: 53
Location: Chennai

PostPosted: Fri Mar 28, 2008 4:36 pm    Post subject:
Reply with quote

Tried that too ... dint help...
Back to top
View user's profile Send private message
samuel_Inba

New User


Joined: 03 Jan 2008
Posts: 53
Location: Chennai

PostPosted: Fri Mar 28, 2008 4:46 pm    Post subject:
Reply with quote

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... icon_sad.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Mar 28, 2008 4:55 pm    Post subject:
Reply with quote

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
View user's profile Send private message
shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 171
Location: Bangalore

PostPosted: Fri Mar 28, 2008 4:59 pm    Post subject: Reply to: find and replace
Reply with quote

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
View user's profile Send private message
samuel_Inba

New User


Joined: 03 Jan 2008
Posts: 53
Location: Chennai

PostPosted: Fri Mar 28, 2008 5:49 pm    Post subject:
Reply with quote

Thanks a lot shrivatsa . icon_smile.gif
Back to top
View user's profile Send private message
samuel_Inba

New User


Joined: 03 Jan 2008
Posts: 53
Location: Chennai

PostPosted: Fri Mar 28, 2008 5:54 pm    Post subject:
Reply with quote

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
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Fri Mar 28, 2008 6:19 pm    Post subject: Reply to: Finding and replacing a string in a VB file
Reply with quote

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
View user's profile Send private message
samuel_Inba

New User


Joined: 03 Jan 2008
Posts: 53
Location: Chennai

PostPosted: Mon Mar 31, 2008 3:05 pm    Post subject: thx
Reply with quote

thx for the reply. It did work...
Back to top
View user's profile Send private message
samuel_Inba

New User


Joined: 03 Jan 2008
Posts: 53
Location: Chennai

PostPosted: Mon Mar 31, 2008 4:04 pm    Post subject:
Reply with quote

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
View user's profile Send private message
samuel_Inba

New User


Joined: 03 Jan 2008
Posts: 53
Location: Chennai

PostPosted: Mon Mar 31, 2008 4:59 pm    Post subject:
Reply with quote

i used the below JCL and it worked....

//SYSIN DD *
$$DD01 UPDATE EDIT=(1,0,C'YYYY',C'////'),
EDIT=(1,0,C'XXXX',C'****')


icon_smile.gif
Back to top
View user's profile Send private message
shobvid

New User


Joined: 03 Apr 2008
Posts: 11
Location: India

PostPosted: Thu Apr 03, 2008 1:51 pm    Post subject: Reply to: Finding and replacing a string in a VB file
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Aug 15, 2008 12:35 am    Post subject:
Reply with quote

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:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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