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

How to change a string containing the command delimiter


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

New User


Joined: 31 May 2017
Posts: 9
Location: Czech

PostPosted: Tue Aug 29, 2017 3:34 pm
Reply with quote

superk wrote:
Since I'm sure that you're aware that the semi-colon ';' is the command delimiter for ISPF, you can't do what you're trying that way. The easiest thing to do is to use the hex representation of the semi-colon instead:

C X'5E' X'40' ALL or C X'5E' ' ' ALL


Hi superK, but what if the semi-colons are in the middle of a string? Like below:

c 'A;B;C' 'A-B-C' all

I tried "AX'E5'B" and 'AX"E5"B', none worked. How do you put the X'5E' in the middle of a string? Thanks!
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1348
Location: Israel

PostPosted: Tue Aug 29, 2017 4:27 pm
Reply with quote

It is better to start a new topic, even if the question is related.

Now, two correct answers:
1. it is always possible to do multiple changes (first change X'5E' to something unusual like ~ [X'A1'], then change 'A~B~C' to whatever, then back from X'A1' to X'5E')

2. Change the command delimiter (Option 0 for ISPF Settings, change command delimiter to something unusual like ~) then 'A;B;C' will work.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Aug 29, 2017 4:56 pm
Reply with quote

Do not resuurect old topics - 11 YEARS this has been sleeping quietly! Even 6 months is too long.
Back to top
View user's profile Send private message
chong.zhou

New User


Joined: 31 May 2017
Posts: 9
Location: Czech

PostPosted: Tue Aug 29, 2017 5:07 pm
Reply with quote

Marso wrote:
It is better to start a new topic, even if the question is related.

Now, two correct answers:
1. it is always possible to do multiple changes (first change X'5E' to something unusual like ~ [X'A1'], then change 'A~B~C' to whatever, then back from X'A1' to X'5E')

2. Change the command delimiter (Option 0 for ISPF Settings, change command delimiter to something unusual like ~) then 'A;B;C' will work.


Cool. I like the second idea, because sometimes the purpose of including semi-colons in the search pattern is just for more accurate matching.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 967
Location: Maryland

PostPosted: Tue Aug 29, 2017 7:17 pm
Reply with quote

chong.zhou wrote:
c 'A;B;C' 'A-B-C' all

I tried "AX'E5'B" and 'AX"E5"B', none worked. How do you put the X'5E' in the middle of a string? Thanks!

For relatively short strings you also can code it whole in hex:
Code:
c  X'C1E5C2E5C3'  'A-B-C' all

Another (less safe) approach is, using "picture" characters
Code:
c  P'A$B$C'  'A-B-C' all

('$' stands for "any special character, neither alphabetic nor numeric")
Back to top
View user's profile Send private message
chong.zhou

New User


Joined: 31 May 2017
Posts: 9
Location: Czech

PostPosted: Tue Aug 29, 2017 8:10 pm
Reply with quote

Thank you sergeyken. Your 1st idea can't be better. Great!!
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 967
Location: Maryland

PostPosted: Tue Aug 29, 2017 10:44 pm
Reply with quote

chong.zhou wrote:
Thank you sergeyken. Your 1st idea can't be better. Great!!

Whenever I was in need of making changes for a very sophisticated combinations of characters, first I used some combination of EXCLUDE/FIND commands - to display only those lines I was interested in, and then used "CHANGE NX ALL ..." command, for not to affect unexpected lines of code.
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 How to replace a string dynamically i... CLIST & REXX 16
No new posts Control M features to check string in... Compuware & Other Tools 0
No new posts Command line placement in DB2I panels TSO/ISPF 2
No new posts A command to change LRECL of an exist... JCL & VSAM 7
No new posts How to pass arguments in a ISPSTART c... CLIST & REXX 6
Search our Forums:

Back to Top