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
 

 

how to find and replace specific words in a program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
venosol
Warnings : 1

New User


Joined: 16 Nov 2006
Posts: 43
Location: Bangalore

PostPosted: Thu Apr 05, 2007 3:21 pm    Post subject: how to find and replace specific words in a program
Reply with quote

In WORKING-STORAGE SECTION I want to find the the data items that are having with 'WS' and must be replaced by 'WK' for ten lines only.

Is there any comand for that ? I know that we can use C for finding and replacing all. How to replace in some lines only.
Back to top
View user's profile Send private message

vkphani

New User


Joined: 29 Oct 2003
Posts: 29

PostPosted: Thu Apr 05, 2007 3:32 pm    Post subject:
Reply with quote

I don't think that is possible.
Back to top
View user's profile Send private message
kgumraj

Active User


Joined: 01 May 2006
Posts: 151
Location: Hyderabad

PostPosted: Thu Apr 05, 2007 3:34 pm    Post subject:
Reply with quote

Hi,

Mark a label so the you can use as
Code:
 C ALL FIRST SECOND .A .B


Where .A and .B are lables.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Thu Apr 05, 2007 3:51 pm    Post subject:
Reply with quote

Use,
Code:
 C 'WS' 'WK'

Press enter.
then press F6 9 times. (this is for repeating same change command)

See, you need to take care while replacing the variables so that you do not wrongly replcace 'other' words than you wanted.
By doing C ALL you have this risk.
When using C ALL .A .B as Kiran suggested use as many chars as possible for example
C ALL 'WS-' 'WK-'. This will replace only variable names starting with 'WS-' not just WS which may be part of other verb/comment/code. icon_smile.gif
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Fri Apr 06, 2007 2:20 am    Post subject:
Reply with quote

Another option is to exclude the ten lines (using XX XX), then use 'C X ALL ...'.

O.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Apr 06, 2007 3:50 am    Post subject:
Reply with quote

Dang, so much to learn, so little time to play around with it..... icon_lol.gif
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Fri Apr 06, 2007 4:17 am    Post subject: Re: how to find and replace specific words in a program
Reply with quote

another way is to set boundries using the command BNDS.

~Vamsi
Back to top
View user's profile Send private message
venosol
Warnings : 1

New User


Joined: 16 Nov 2006
Posts: 43
Location: Bangalore

PostPosted: Fri Apr 06, 2007 8:29 am    Post subject: Re: how to find and replace specific words in a program
Reply with quote

shreevamsi wrote:
another way is to set boundries using the command BNDS.

~Vamsi


what is the syntax for using BNDS?
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Fri Apr 06, 2007 9:10 am    Post subject: Re: how to find and replace specific words in a program
Reply with quote

Hi,

Type BNDS or BND in the line command area of any line and press ENTER.
The bounds line will then be displayed as follows.
000300
=BNDS> < >
000400
The bounds may then be changed by overtyping with < to define the left
bound and > to define the right bound. To remove the bounds line from the display, use the D line command or the RESET primary command.

Bounds are used with scrolling, shift line commands ( ">", "<", ")", "(" ),
text line commands ( "TS", "TF", "TE" ) and FIND , CHANGE , EXCLUDE , and SORT commands.
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 964
Location: Richmond, Virginia

PostPosted: Fri Apr 06, 2007 5:33 pm    Post subject:
Reply with quote

General Suggestion for exploring new (to you) TSO features:

There is a wealth of help in the HELP (F1) screens.

Whereas you might not know about the existence of a command or feature (happens to me all the time), once you do, reading up in HELP and then experimenting will enable you with respect to that feature much more than just being told by someone else.
Back to top
View user's profile Send private message
mainframe_96

New User


Joined: 18 Dec 2006
Posts: 13
Location: usa

PostPosted: Fri Apr 06, 2007 6:10 pm    Post subject: Re: how to find and replace specific words in a program
Reply with quote

Most of the time i Use x all, f 'WS-' all

c 'xx' 'yy' x all or
c 'xx' 'yy' nx all

Nx all changes in not excluded lines
X all changes in excluded lines

what ofer71 said will work for you in this case, However if you had to change except for those 10 lines you excluded then use NX.
Back to top
View user's profile Send private message
jasorn

Active User


Joined: 12 Jul 2006
Posts: 153
Location: USA

PostPosted: Sat Apr 07, 2007 3:26 am    Post subject: Re: how to find and replace specific words in a program
Reply with quote

shreevamsi wrote:
another way is to set boundries using the command BNDS.

~Vamsi

You can set bounds for lines? Thought you could only set bounds for columns.
Back to top
View user's profile Send private message
GlobalGyan

New User


Joined: 31 Jan 2006
Posts: 28

PostPosted: Tue Apr 10, 2007 11:09 am    Post subject:
Reply with quote

for 10 lines you can change manually :=)

-
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Compiling program in endeavor for tra... RALAKKAL Compuware & Other Tools 4 Mon Jun 05, 2017 8:27 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am


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