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 replace a string using exclude and change command

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: How to replace a string using exclude and change command
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    Post subject:
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    Post subject:
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: 7990
Location: Bellevue, IA

PostPosted: Mon Dec 21, 2009 9:50 pm    Post subject:
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    Post subject:
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: 1002
Location: Oostende, Belgium

PostPosted: Tue Dec 22, 2009 12:19 am    Post subject:
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    Post subject:
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: 7990
Location: Bellevue, IA

PostPosted: Tue Dec 22, 2009 7:22 pm    Post subject:
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    Post subject:
Reply with quote

Robert, an Extended ASCII Chart can be found at http://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: 7990
Location: Bellevue, IA

PostPosted: Tue Dec 22, 2009 8:20 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Customizing the ISPF HILITE Command Pedro TSO/ISPF 3 Fri Mar 03, 2017 11:49 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm


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