IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to find and replace specific words in a program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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: 691
Location: Earth

PostPosted: Thu Apr 05, 2007 3:51 pm
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: 2358
Location: Israel

PostPosted: Fri Apr 06, 2007 2:20 am
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: 3156
Location: Tucson AZ

PostPosted: Fri Apr 06, 2007 3:50 am
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
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
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
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

Senior Member


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

PostPosted: Fri Apr 06, 2007 5:33 pm
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
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
Warnings : 1

Active User


Joined: 12 Jul 2006
Posts: 191
Location: USA

PostPosted: Sat Apr 07, 2007 3:26 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts DB2 Event passed to the Application P... DB2 1
Search our Forums:

Back to Top