View previous topic :: View next topic
|
Author |
Message |
rulerofera
New User
Joined: 03 Jun 2008 Posts: 30 Location: India
|
|
|
|
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 |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
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 |
|
|
Ronald Burr
Active User
Joined: 22 Oct 2009 Posts: 293 Location: U.S.A.
|
|
|
|
What's so hard about a simple change command?
Code: |
C 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' ' ' 72 ALL X |
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Thanks Robert. I forgot about the fact that the string appears in positions 72 through 99 only. 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 |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
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 |
|
|
rulerofera
New User
Joined: 03 Jun 2008 Posts: 30 Location: India
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Which will work real well on my laptop here since it does not have a keypad! 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 |
|
|
|