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

How to replace a string using exclude and change command


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rulerofera

New User


Joined: 03 Jun 2008
Posts: 30
Location: India

PostPosted: Mon Dec 21, 2009 9:38 pm
Reply with quote

I am having a physical sequential file with record length of 133.

Now there are some lines in the file which has string xxxxxx from column 72 through 99.
Now I need to replace this 28 character string with all spaces.

My progress so far:
I first issued exclude command as
X ALL "XXXXXXXXXXXXXXXXXXXXX" 72
then I need to change this string 'XXXXXXXXXXXXXXXXXXXXXX' from excluded lines to all spaces how can I do that.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Mon Dec 21, 2009 9:46 pm
Reply with quote

Due to the limitation of the length of the CMD line in ISPF, I would do it as the following 2 ISPF commands:
Code:
c '<-your 28-character string->' '!@#$%' all
c '!@#$%' '                            ' all
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Mon Dec 21, 2009 9:47 pm
Reply with quote

What's so hard about a simple change command?

Code:
C 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX'  ' ' 72 ALL X
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Mon Dec 21, 2009 9:50 pm
Reply with quote

Set boundaries to 72 99
C P'^' ' ' X ALL
Reset boundaries

where P'^' is the shift-6 character (not symbol) that represents any character. Since you've excluded the lines you want changed, you don't have to match the entire 28-byte string -- you did that when you did the exclude.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Mon Dec 21, 2009 9:55 pm
Reply with quote

Thanks Robert. I forgot about the fact that the string appears in positions 72 through 99 only. icon_redface.gif My method could be modified to restrict itself to those positions only.
Ronald,
Your command will replace the 28-char string by just one space. I don't think that was the intial requirement.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Tue Dec 22, 2009 12:19 am
Reply with quote

Code:
x all
f '<-your 28-character string->' all col-1 col-2
c * '                            ' all col-1 col-2 nx


Or use an edit macro which allows strings up to the maximum of 255 characters....
Back to top
View user's profile Send private message
rulerofera

New User


Joined: 03 Jun 2008
Posts: 30
Location: India

PostPosted: Tue Dec 22, 2009 7:01 pm
Reply with quote

Thanks to all for your responses.

Yes Terry, command Line limitation was one of the factor that I was not able to execute otherwise trivial Change command replacing some 28 chars with 28 spaces.

Robert,
The command C P'^' ' ' X ALL that you gave was not working so I did some searching and found that P'=' is used to denote any character in C command. So I executed the command as
C P'=' ' ' X ALL
and it worked. Thanks a lot for your suggestion.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Tue Dec 22, 2009 7:22 pm
Reply with quote

I just checked -- the shift-6 character (caret or not symbol) in a change command picture changes non-blanks; the = sign changes all characters. The results should be the same for what you're doing.

Anyway, glad it worked!
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Dec 22, 2009 8:16 pm
Reply with quote

Robert, an Extended ASCII Chart can be found at www.cdrummond.qc.ca/cegep/informat/Professeurs/Alain/files/ascii.htm where you can key "non-keyboard" characters. Key 170 while holding down the Alt key to get ¬. icon_smile.gif The 170 must be keyed using the keypad though, not the numbers on the top row.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Tue Dec 22, 2009 8:20 pm
Reply with quote

Which will work real well on my laptop here since it does not have a keypad! icon_smile.gif I've got a docking station at work that does have the keypad, but sometimes I get to work from home and then it's me and the laptop keyboard only ...
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Routing command Address SDSF to other... TSO/ISPF 2
Search our Forums:

Back to Top