Hi everybody!
When I assign a string containing backslashes to a string variable in a REXX program, the contents of the variable have colons in place of the backslashes.
Could someone help me by explaining why this happens and also helping me solve it by keeping the backslashes? The string is a windows path.
/* REXX */
PATH = 'C:\WINDOWS\TEMP'
SAY PATH
The response is:
C::WINDOWS:TEMP
Backslashes substituted by colons
-
- Posts: 8
- Joined: Thu May 05, 2022 7:46 pm
- Skillset: About 50 years of experience in Mainframe Programming
- Referer: Google
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: Backslashes substituted by colons
This is not REXX or ISPF problem, this is TSO problem.
REXX command SAY sends the string content to TSO, in order it to display the string on the terminal screen. TSO by default assumes the terminal is the most stupid one, and it may not be able to display some non-standard characters. So, before displaying the string on terminal TSO replaces all "suspicious" (from its point of view) characters with ':', and then allows the string to be displayed.
This wouldn't happen if you wrote your string to a dataset, or used tools like FTP, or whatever else.
REXX command SAY sends the string content to TSO, in order it to display the string on the terminal screen. TSO by default assumes the terminal is the most stupid one, and it may not be able to display some non-standard characters. So, before displaying the string on terminal TSO replaces all "suspicious" (from its point of view) characters with ':', and then allows the string to be displayed.
This wouldn't happen if you wrote your string to a dataset, or used tools like FTP, or whatever else.
Javas and Pythons come and go, but JCL and SORT stay forever.
-
- Posts: 8
- Joined: Thu May 05, 2022 7:46 pm
- Skillset: About 50 years of experience in Mainframe Programming
- Referer: Google
Re: Backslashes substituted by colons
When I open the source program in the ISPF editor, this change that I mentioned does not happen. The backslashes appear normally in the terminal screen.
Could it be that if I save my strings in a dataset and then edit it, I will receive backslashes? Because, as I don't have REXX on my notebook (and I can't even install anything on it. It's full of protections) I was thinking about creating the strings I need on the notebook on the mainframe, and then taking them to the notebook with copy/paste.
Will it work?
Cheers
Could it be that if I save my strings in a dataset and then edit it, I will receive backslashes? Because, as I don't have REXX on my notebook (and I can't even install anything on it. It's full of protections) I was thinking about creating the strings I need on the notebook on the mainframe, and then taking them to the notebook with copy/paste.
Will it work?
Cheers
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: Backslashes substituted by colons
I repeat once again.
THE BACKSLASH IS CONVERTED TO COLON ONLY BY TSO WHEN PREPARING THE STRING TO BE DISPLAYED ON THE WORST POSSIBLE TERMINAL TYPE.
In all other cases THIS CONVERSION IS NOT DONE.
P.S.
It would be much easier for you just to run several self-explaining tests on write/read various data to and from datasets, rather than re-asking the same questions on this forum.
P.P.S.
It looks strange that the only your goal is: to display the text containing backslashes on the screen, without using this text for something more useful?
THE BACKSLASH IS CONVERTED TO COLON ONLY BY TSO WHEN PREPARING THE STRING TO BE DISPLAYED ON THE WORST POSSIBLE TERMINAL TYPE.
In all other cases THIS CONVERSION IS NOT DONE.
P.S.
It would be much easier for you just to run several self-explaining tests on write/read various data to and from datasets, rather than re-asking the same questions on this forum.
P.P.S.
It looks strange that the only your goal is: to display the text containing backslashes on the screen, without using this text for something more useful?
Javas and Pythons come and go, but JCL and SORT stay forever.