Discussion:
REXX Upper case letter issue
(too old to reply)
Mainframe Mainframe
2015-11-12 08:21:06 UTC
Permalink
Raw Message
I am new in Rexx and just trying to automate the host detail using this
rexx program.

In this rexx I am expecting user to pass host name and then rexx will
fetch all detail about that host.

The issue is that the input file from where the the rexx fetch the detail
are in small letters. So, when we run the rexx and if anybody type host
name in capital letter then rexx doesnt understand anythng and gives me
error.

I checked in rexx online manual but dont have any inbuilt function for
doing this task. Can you please help me solving this issue.

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Höglund Lars
2015-11-12 08:30:09 UTC
Permalink
Raw Message
TRANSLATE?

//Lasse

-----Ursprungligt meddelande-----
Från: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] För Mainframe Mainframe
Skickat: den 12 november 2015 09:21
Till: TSO-***@VM.MARIST.EDU
Ämne: [TSO-REXX] REXX Upper case letter issue

I am new in Rexx and just trying to automate the host detail using this rexx program.

In this rexx I am expecting user to pass host name and then rexx will
fetch all detail about that host.

The issue is that the input file from where the the rexx fetch the detail are in small letters. So, when we run the rexx and if anybody type host name in capital letter then rexx doesnt understand anythng and gives me error.

I checked in rexx online manual but dont have any inbuilt function for doing this task. Can you please help me solving this issue.

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Michael Klaeschen
2015-11-12 08:33:13 UTC
Permalink
Raw Message
PARSE UPPER file input and go on with majuscles. Or TRANSLATE user input
to minuscles.




Von: Mainframe Mainframe <***@GMAIL.COM>
An: TSO-***@VM.MARIST.EDU,
Datum: 12.11.2015 09:22
Betreff: [TSO-REXX] REXX Upper case letter issue
Gesendet von: TSO REXX Discussion List <TSO-***@VM.MARIST.EDU>



I am new in Rexx and just trying to automate the host detail using this
rexx program.

In this rexx I am expecting user to pass host name and then rexx will
fetch all detail about that host.

The issue is that the input file from where the the rexx fetch the detail
are in small letters. So, when we run the rexx and if anybody type host
name in capital letter then rexx doesnt understand anythng and gives me
error.

I checked in rexx online manual but dont have any inbuilt function for
doing this task. Can you please help me solving this issue.

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

_________________________
_________________________
____________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
_________________________
_________________________
____________________


Basler Sachversicherungs-AG
Amtsgericht Bad Homburg v.d.H., HRB 9357 | USt-ID-Nr. DE 276021973
Basler Straße 4, 61345 Bad Homburg v.d.H.
Vorstand: Dr. Jürg Schiltknecht - Vorsitzender, Kay Bölke, Markus Jost,
Ralf Stankat, Dr. Alexander Tourneau
Aufsichtsratsvorsitzender: Dr. Martin Strobel

Basler Lebensversicherungs-AG |
Amtsgericht Hamburg, HRB 4659 | Ust-ID-Nr. DE 276021973
Ludwig-Erhard-Straße 22, 20459 Hamburg
Vorstand: Dr. Jürg Schiltknecht - Vorsitzender, Kay Bölke, Markus Jost,
Ralf Stankat, Dr. Alexander Tourneau
Aufsichtsratsvorsitzender: Dr. Martin Strobel

Basler Versicherung AG Direktion für Deutschland |
Amtsgericht Bad Homburg v.d.H., HRB 1228 | USt-ID-Nr. DE 281452875
Basler Straße 4, 61345 Bad Homburg v.d.H.
Hauptbevollmächtigter für Deutschland: Dr. Jürg Schiltknecht

Basler Leben AG Direktion für Deutschland |
Amtsgericht Bad Homburg v.d.H., HRB 1229 | Ust-ID-Nr. DE 281452875
Basler Straße 4, 61345 Bad Homburg v.d.H.
Hauptbevollmächtigter für Deutschland: Dr. Jürg Schiltknecht

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Mainframe Mainframe
2015-11-12 08:45:33 UTC
Permalink
Raw Message
I want to convert upper case to lower, if anybody type host name in upper
case . If they type in lower case , my script works fine but input text
file has all host name written in lower case.

Can you please explain in this detail.

On Thu, Nov 12, 2015 at 2:02 PM, Michael Klaeschen <
Post by Michael Klaeschen
PARSE UPPER file input and go on with majuscles. Or TRANSLATE user input
to minuscles.
Datum: 12.11.2015 09:22
Betreff: [TSO-REXX] REXX Upper case letter issue
I am new in Rexx and just trying to automate the host detail using this
rexx program.
In this rexx I am expecting user to pass host name and then rexx will
fetch all detail about that host.
The issue is that the input file from where the the rexx fetch the detail
are in small letters. So, when we run the rexx and if anybody type host
name in capital letter then rexx doesnt understand anythng and gives me
error.
I checked in rexx online manual but dont have any inbuilt function for
doing this task. Can you please help me solving this issue.
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
_________________________
_________________________
____________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
_________________________
_________________________
____________________
Basler Sachversicherungs-AG
Amtsgericht Bad Homburg v.d.H., HRB 9357 | USt-ID-Nr. DE 276021973
Basler Straße 4, 61345 Bad Homburg v.d.H.
Vorstand: Dr. Jürg Schiltknecht - Vorsitzender, Kay Bölke, Markus Jost,
Ralf Stankat, Dr. Alexander Tourneau
Aufsichtsratsvorsitzender: Dr. Martin Strobel
Basler Lebensversicherungs-AG |
Amtsgericht Hamburg, HRB 4659 | Ust-ID-Nr. DE 276021973
Ludwig-Erhard-Straße 22, 20459 Hamburg
Vorstand: Dr. Jürg Schiltknecht - Vorsitzender, Kay Bölke, Markus Jost,
Ralf Stankat, Dr. Alexander Tourneau
Aufsichtsratsvorsitzender: Dr. Martin Strobel
Basler Versicherung AG Direktion für Deutschland |
Amtsgericht Bad Homburg v.d.H., HRB 1228 | USt-ID-Nr. DE 281452875
Basler Straße 4, 61345 Bad Homburg v.d.H.
Hauptbevollmächtigter für Deutschland: Dr. Jürg Schiltknecht
Basler Leben AG Direktion für Deutschland |
Amtsgericht Bad Homburg v.d.H., HRB 1229 | Ust-ID-Nr. DE 281452875
Basler Straße 4, 61345 Bad Homburg v.d.H.
Hauptbevollmächtigter für Deutschland: Dr. Jürg Schiltknecht
______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Walter Pachl
2015-11-12 08:49:41 UTC
Permalink
Raw Message
abc='abc...'
abc_u=translate(abc)
t=translate(s,abc,abc_u)
Walter

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Lizette Koehler
2015-11-12 14:28:56 UTC
Permalink
Raw Message
You might try putting in a test

(Pseudo code)

If data = Upper case, then X
Else, Y

Test to see if data is upper or lower case, then translate as needed. Or you could translate all the time. Use a temp var. You will not be changing the original data that way.

Lizette
-----Original Message-----
Mainframe Mainframe
Sent: Thursday, November 12, 2015 1:45 AM
Subject: Re: [TSO-REXX] REXX Upper case letter issue
I want to convert upper case to lower, if anybody type host name in upper case . If
they type in lower case , my script works fine but input text file has all host name
written in lower case.
Can you please explain in this detail.
On Thu, Nov 12, 2015 at 2:02 PM, Michael Klaeschen <
Post by Michael Klaeschen
PARSE UPPER file input and go on with majuscles. Or TRANSLATE user
input to minuscles.
Datum: 12.11.2015 09:22
Betreff: [TSO-REXX] REXX Upper case letter issue
I am new in Rexx and just trying to automate the host detail using
this rexx program.
In this rexx I am expecting user to pass host name and then rexx will
fetch all detail about that host.
The issue is that the input file from where the the rexx fetch the
detail are in small letters. So, when we run the rexx and if anybody
type host name in capital letter then rexx doesnt understand anythng
and gives me error.
I checked in rexx online manual but dont have any inbuilt function
for doing this task. Can you please help me solving this issue.
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Baldon, David
2015-11-13 15:59:08 UTC
Permalink
Raw Message
lcase = 'abcdefghijklmnopqrstuvwxyz'
ucase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

if translate(user_host, lcase, ucase) = file_host then
say "Bob's your uncle"

Flip the lcase and ucase variables in the translate function to go the other way.

If you need to compare the value in user_host more than once, I recommend translating the value just once and then using the translated value in any subsequent comparisons. Like this;
user_host = translate(user_host, lcase, ucase)
if user_host = file_host then
say "Bob's your uncle"

...David

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Mainframe Mainframe
Sent: Thursday, November 12, 2015 2:45 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: REXX Upper case letter issue

I want to convert upper case to lower, if anybody type host name in upper
case . If they type in lower case , my script works fine but input text
file has all host name written in lower case.

Can you please explain in this detail.

On Thu, Nov 12, 2015 at 2:02 PM, Michael Klaeschen <
Post by Michael Klaeschen
PARSE UPPER file input and go on with majuscles. Or TRANSLATE user input
to minuscles.
Datum: 12.11.2015 09:22
Betreff: [TSO-REXX] REXX Upper case letter issue
I am new in Rexx and just trying to automate the host detail using this
rexx program.
In this rexx I am expecting user to pass host name and then rexx will
fetch all detail about that host.
The issue is that the input file from where the the rexx fetch the detail
are in small letters. So, when we run the rexx and if anybody type host
name in capital letter then rexx doesnt understand anythng and gives me
error.
I checked in rexx online manual but dont have any inbuilt function for
doing this task. Can you please help me solving this issue.
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
_________________________
_________________________
____________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit https://urldefense.proofpoint.com/v2/url?u=http-3A__www.symanteccloud.com&d=BQIFaQ&c=UrUhmHsiTVT5qkaA4d_oSzcamb9hmamiCDMzBAEwC7E&r=KigCN-TlaQoAQDZrna0ZVLUX9H9vZpSibySEyujWvHQ&m=I42TKubvjxqdBf7TuEynRX_AKykaod2tWoPFlRNk0yI&s=8yBwVp5KV9-HM8kT0_tEijLlr9Ox2JsX8vwVBEYa8c0&e=
_________________________
_________________________
____________________
Basler Sachversicherungs-AG
Amtsgericht Bad Homburg v.d.H., HRB 9357 | USt-ID-Nr. DE 276021973
Basler Straße 4, 61345 Bad Homburg v.d.H.
Vorstand: Dr. Jürg Schiltknecht - Vorsitzender, Kay Bölke, Markus Jost,
Ralf Stankat, Dr. Alexander Tourneau
Aufsichtsratsvorsitzender: Dr. Martin Strobel
Basler Lebensversicherungs-AG |
Amtsgericht Hamburg, HRB 4659 | Ust-ID-Nr. DE 276021973
Ludwig-Erhard-Straße 22, 20459 Hamburg
Vorstand: Dr. Jürg Schiltknecht - Vorsitzender, Kay Bölke, Markus Jost,
Ralf Stankat, Dr. Alexander Tourneau
Aufsichtsratsvorsitzender: Dr. Martin Strobel
Basler Versicherung AG Direktion für Deutschland |
Amtsgericht Bad Homburg v.d.H., HRB 1228 | USt-ID-Nr. DE 281452875
Basler Straße 4, 61345 Bad Homburg v.d.H.
Hauptbevollmächtigter für Deutschland: Dr. Jürg Schiltknecht
Basler Leben AG Direktion für Deutschland |
Amtsgericht Bad Homburg v.d.H., HRB 1229 | Ust-ID-Nr. DE 281452875
Basler Straße 4, 61345 Bad Homburg v.d.H.
Hauptbevollmächtigter für Deutschland: Dr. Jürg Schiltknecht
______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit https://urldefense.proofpoint.com/v2/url?u=http-3A__www.symanteccloud.com&d=BQIFaQ&c=UrUhmHsiTVT5qkaA4d_oSzcamb9hmamiCDMzBAEwC7E&r=KigCN-TlaQoAQDZrna0ZVLUX9H9vZpSibySEyujWvHQ&m=I42TKubvjxqdBf7TuEynRX_AKykaod2tWoPFlRNk0yI&s=8yBwVp5KV9-HM8kT0_tEijLlr9Ox2JsX8vwVBEYa8c0&e=
______________________________________________________________________
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Robin Ryerse
2015-11-12 14:40:49 UTC
Permalink
Raw Message
always_lower = bitor(source_text,x'7f7f7f7f.....')


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Mainframe Mainframe
Sent: November 12, 2015 3:20 AM
To: TSO-***@VM.MARIST.EDU
Subject: [TSO-REXX] REXX Upper case letter issue

I am new in Rexx and just trying to automate the host detail using this rexx program.

In this rexx I am expecting user to pass host name and then rexx will
fetch all detail about that host.

The issue is that the input file from where the the rexx fetch the detail are in small letters. So, when we run the rexx and if anybody type host name in capital letter then rexx doesnt understand anythng and gives me error.

I checked in rexx online manual but dont have any inbuilt function for doing this task. Can you please help me solving this issue.

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Paul Gilmartin
2015-11-13 15:00:44 UTC
Permalink
Raw Message
Post by Robin Ryerse
always_lower = bitor(source_text,x'7f7f7f7f.....')
Won't that convert every character in source_text either to '7f'x or
to 'ff'x?

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Nims,Alva John , Al
2015-11-13 15:41:01 UTC
Permalink
Raw Message
Yes, I think it would and anything that attempted to use any of the "bitxxxx" routines of REXX (attempt to turn the second bit of the 8 bit string off ("0")), you would have to make sure that only letters are involved, if there was a number in there it make it an unusable character, let alone what would happen if there were any of the allowed special characters in the string.

I think the best method would be to use a more "brute force" method:
Lower = xrange("a","i")||xrange("j","r")||xrange("s","z");
Upper = xrange("A","I")||xrange("J","R")||xrange("S","Z");
........
Always_lower = translate(source,lower,upper);

This way any numbers or special characters would be unaffected.

Al Nims
Systems Admin/Programmer 3
EI&O
University of Florida
(352) 273-1298

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@vm.marist.edu] On Behalf Of Paul Gilmartin
Sent: Friday, November 13, 2015 9:54 AM
To: TSO-***@vm.marist.edu
Subject: Re: [TSO-REXX] REXX Upper case letter issue
Post by Robin Ryerse
always_lower = bitor(source_text,x'7f7f7f7f.....')
Won't that convert every character in source_text either to '7f'x or to 'ff'x?

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Paul Gilmartin
2015-11-13 15:47:28 UTC
Permalink
Raw Message
Post by Nims,Alva John , Al
Yes, I think it would and anything that attempted to use any of the "bitxxxx" routines of REXX (attempt to turn the second bit of the 8 bit string off ("0")), you would have to make sure that only letters are involved, if there was a number in there it make it an unusable character, let alone what would happen if there were any of the allowed special characters in the string.
Lower = xrange("a","i")||xrange("j","r")||xrange("s","z");
Upper = xrange("A","I")||xrange("J","R")||xrange("S","Z");
........
Always_lower = translate(source,lower,upper);
This way any numbers or special characters would be unaffected.
Yet one might wonder why, given that z/OS resources (DSNs, member names,
system names) are conventionally, canonically in majuscule, they appear
perversely in lower case in the OP's reference file.

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Robert Garrett
2015-11-14 17:17:28 UTC
Permalink
Raw Message
Yes it would - trash a bunch of other characters that is.

But I was also taking advantage here that the OP specified he was working
with domain names, and the only valid characters for domain names are the
alphabetics, the numerics, plus . (dot) and - (hyphen).
So none of the other characters should ever appear in any of the data he's
working with. If they do, then it's not a valid domain name. I supposed I
should have added one more character to the "restore" logic and that would
have been : (colon) x'7A' for cases when there's an explicit port specified
along with the domain name (if that applies to his situation).

Again, I'm not saying my solution was the "best", it was just another way to
accomplish the stated job that I found mentally entertaining.

Here's a modified way to do it that doesn't trash any characters and avoids
having to type in the alphabet multiple times (still EBCDIC only).

/* This only needs to be done once to initialize _LOWMASK and _HIGHMASK */
_RANGE1 = BITAND('123456789',COPIES('10001111'b,9)); /*generate lowercase a
thru i */
_RANGE2 = BITAND('123456789',COPIES('10011111'b,9)); /*generate lowercase j
thru r */
_RANGE3 = BITAND('23456789',COPIES('10101111'b,9)); /*generate lowercase s
thru z */
_LOWMASK = _RANGE1||_RANGE2||_RANGE3; /* lowercase alphabet */
_HIGHMASK = TRANSLATE(_LOWMASK); /* uppercase alphabet */

/* Then whenever you need to convert upper to lower, just... */
_OUTPUT = TRANSLATE(_INPUT,_LOWMASK,_HIGHMASK);

I love REXX. For working with and manipulating character data in an
arbitrary format, "scraping" information out of formatted reports, command
output, etc. there is no other language that comes close to its capabilities
- especially when you need/want to design logic that has the ability to
insulate itself from minor format changes in the input data without
breaking.

For the 'heavy lifting', I write Assembler.

Robert

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
Paul Gilmartin
Sent: Friday, November 13, 2015 8:54 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] REXX Upper case letter issue
Post by Robin Ryerse
always_lower = bitor(source_text,x'7f7f7f7f.....')
Won't that convert every character in source_text either to '7f'x or to
'ff'x?

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email
to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Robert Garrett
2015-11-14 17:25:03 UTC
Permalink
Raw Message
...or similarly...

_LOWER = TRANSLATE(_UPPER,XRANGE('a','i')||XRANGE('j','r')||XRANGE('s','z'),
XRANGE('A','I')||XRANGE('J','R')||XRANGE('S','Z'));

... all in one swell foop... :)

Robert

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
Paul Gilmartin
Sent: Friday, November 13, 2015 8:54 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] REXX Upper case letter issue
Post by Robin Ryerse
always_lower = bitor(source_text,x'7f7f7f7f.....')
Won't that convert every character in source_text either to '7f'x or to
'ff'x?

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email
to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
c***@gmail.com
2016-05-29 17:09:15 UTC
Permalink
Raw Message
-

Robin Ryerse
2015-11-12 14:59:22 UTC
Permalink
Raw Message
My earlier response using BITOR() will work only if the source is all alpha. Numerics in the source will become unrecognizable.




-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Mainframe Mainframe
Sent: November 12, 2015 3:20 AM
To: TSO-***@VM.MARIST.EDU
Subject: [TSO-REXX] REXX Upper case letter issue

I am new in Rexx and just trying to automate the host detail using this rexx program.

In this rexx I am expecting user to pass host name and then rexx will
fetch all detail about that host.

The issue is that the input file from where the the rexx fetch the detail are in small letters. So, when we run the rexx and if anybody type host name in capital letter then rexx doesnt understand anythng and gives me error.

I checked in rexx online manual but dont have any inbuilt function for doing this task. Can you please help me solving this issue.

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Ken MacKenzie
2015-11-12 15:09:35 UTC
Permalink
Raw Message
In these situations (when users are involved) and are expected to type all
upper or all lower, I always allow for finger trouble and I would do
something like:

If Translate(user_supplied_data) = Translate(data_from_file) Then
Whatever

So, if the data contains BaNaNa and the user types bAnAnA it still
matches.

Nice simple approach - no data is changed permanently.

Ken MacKenzie
Pramerica Systems Ireland Limited
is a private company limited by shares
incorporated and registered in the Republic of Ireland with registered
number 319900
and registered office at 6th Floor, South Bank House, Barrow Street,
Dublin 4, Ireland.




From: Mainframe Mainframe <***@GMAIL.COM>
To: TSO-***@VM.MARIST.EDU,
Date: 12/11/2015 08:21
Subject: [TSO-REXX] REXX Upper case letter issue
Sent by: TSO REXX Discussion List <TSO-***@VM.MARIST.EDU>



I am new in Rexx and just trying to automate the host detail using this
rexx program.

In this rexx I am expecting user to pass host name and then rexx will
fetch all detail about that host.

The issue is that the input file from where the the rexx fetch the detail
are in small letters. So, when we run the rexx and if anybody type host
name in capital letter then rexx doesnt understand anythng and gives me
error.

I checked in rexx online manual but dont have any inbuilt function for
doing this task. Can you please help me solving this issue.

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX



----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Farley, Peter x23353
2015-11-12 15:32:04 UTC
Permalink
Raw Message
TRANSLATE(hostname, XRANGE('a', 'z'), XRANGE('A', 'Z'))

You can make the XRANGE's a concatenation of a-I, j-r, s-z if you want to be totally accurate, but the single ranges should do for most characters that can be typed at a keyboard.

HTH

Peter

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Mainframe Mainframe
Sent: Thursday, November 12, 2015 3:20 AM
To: TSO-***@VM.MARIST.EDU
Subject: REXX Upper case letter issue

I am new in Rexx and just trying to automate the host detail using this
rexx program.

In this rexx I am expecting user to pass host name and then rexx will
fetch all detail about that host.

The issue is that the input file from where the the rexx fetch the detail
are in small letters. So, when we run the rexx and if anybody type host
name in capital letter then rexx doesnt understand anythng and gives me
error.

I checked in rexx online manual but dont have any inbuilt function for
doing this task. Can you please help me solving this issue.

--


This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.
Ken MacKenzie
2015-11-12 15:46:24 UTC
Permalink
Raw Message
There's no need for the second and third parameters. The default for
TRANSLATE is to convert to UPPER-CASE.

From REXX Reference manual:
If you specify neither translation table and omit pad, string is simply
translated to uppercase (that is, lowercase a?z to uppercase A?Z)

Ken MacKenzie
Pramerica Systems Ireland Limited
is a private company limited by shares
incorporated and registered in the Republic of Ireland with registered
number 319900
and registered office at 6th Floor, South Bank House, Barrow Street,
Dublin 4, Ireland.




From: "Farley, Peter x23353" <***@BROADRIDGE.COM>
To: TSO-***@VM.MARIST.EDU,
Date: 12/11/2015 15:33
Subject: Re: [TSO-REXX] REXX Upper case letter issue
Sent by: TSO REXX Discussion List <TSO-***@VM.MARIST.EDU>



TRANSLATE(hostname, XRANGE('a', 'z'), XRANGE('A', 'Z'))

You can make the XRANGE's a concatenation of a-I, j-r, s-z if you want to
be totally accurate, but the single ranges should do for most characters
that can be typed at a keyboard.

HTH

Peter

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf
Of Mainframe Mainframe
Sent: Thursday, November 12, 2015 3:20 AM
To: TSO-***@VM.MARIST.EDU
Subject: REXX Upper case letter issue

I am new in Rexx and just trying to automate the host detail using this
rexx program.

In this rexx I am expecting user to pass host name and then rexx will
fetch all detail about that host.

The issue is that the input file from where the the rexx fetch the detail
are in small letters. So, when we run the rexx and if anybody type host
name in capital letter then rexx doesnt understand anythng and gives me
error.

I checked in rexx online manual but dont have any inbuilt function for
doing this task. Can you please help me solving this issue.

--


This message and any attachments are intended only for the use of the
addressee and may contain information that is privileged and confidential.
If the reader of the message is not the intended recipient or an
authorized representative of the intended recipient, you are hereby
notified that any dissemination of this communication is strictly
prohibited. If you have received this communication in error, please
notify us immediately by e-mail and delete the message and any attachments
from your system.


----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Farley, Peter x23353
2015-11-12 16:23:44 UTC
Permalink
Raw Message
Please re-read the OP's second message. He asks how to convert input to lower case, not upper.

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Ken MacKenzie
Sent: Thursday, November 12, 2015 10:46 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: REXX Upper case letter issue

There's no need for the second and third parameters. The default for
TRANSLATE is to convert to UPPER-CASE.

From REXX Reference manual:
If you specify neither translation table and omit pad, string is simply
translated to uppercase (that is, lowercase a?z to uppercase A?Z)

Ken MacKenzie
Pramerica Systems Ireland Limited
is a private company limited by shares
incorporated and registered in the Republic of Ireland with registered
number 319900
and registered office at 6th Floor, South Bank House, Barrow Street,
Dublin 4, Ireland.




From: "Farley, Peter x23353" <***@BROADRIDGE.COM>
To: TSO-***@VM.MARIST.EDU,
Date: 12/11/2015 15:33
Subject: Re: [TSO-REXX] REXX Upper case letter issue
Sent by: TSO REXX Discussion List <TSO-***@VM.MARIST.EDU>



TRANSLATE(hostname, XRANGE('a', 'z'), XRANGE('A', 'Z'))

You can make the XRANGE's a concatenation of a-I, j-r, s-z if you want to
be totally accurate, but the single ranges should do for most characters
that can be typed at a keyboard.

HTH

Peter

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf
Of Mainframe Mainframe
Sent: Thursday, November 12, 2015 3:20 AM
To: TSO-***@VM.MARIST.EDU
Subject: REXX Upper case letter issue

I am new in Rexx and just trying to automate the host detail using this
rexx program.

In this rexx I am expecting user to pass host name and then rexx will
fetch all detail about that host.

The issue is that the input file from where the the rexx fetch the detail
are in small letters. So, when we run the rexx and if anybody type host
name in capital letter then rexx doesnt understand anythng and gives me
error.

I checked in rexx online manual but dont have any inbuilt function for
doing this task. Can you please help me solving this issue.

--


This message and any attachments are intended only for the use of the
addressee and may contain information that is privileged and confidential.
If the reader of the message is not the intended recipient or an
authorized representative of the intended recipient, you are hereby
notified that any dissemination of this communication is strictly
prohibited. If you have received this communication in error, please
notify us immediately by e-mail and delete the message and any attachments
from your system.


----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Robert Zenuk
2015-11-12 21:53:38 UTC
Permalink
Raw Message
I frequently use the same technique Ken suggests. Here is something quick and dirty that does lookups against "mixed" data.

/* rexx */
arg hostlist
host.1 = 'myhost1'
host.2 = 'MYHOST2'
host.3 = 'myhost3'
host.4 = 'MYHOST4'
host.5 = 'myhost5'
host.6 = 'MYHOST6'
host.7 = 'myhost7'
host.8 = 'MYHOST8'
host.9 = 'myhost9'
host.10 = 'vmhost1'
host.11 = 'VMHOST2'
host.12 = 'vmhost3'
host.13 = 'VMHOST4'
host.14 = 'vmhost5'
host.15 = 'VMHOST6'
host.16 = 'vmhost7'
host.17 = 'VMHOST8'
host.18 = 'vmhost9'
host.0 = 18
hosts = 0
say 'Looking for hosts containing:' hostlist
do l=1 to host.0
do h=1 to words(hostlist)
if pos(word(hostlist,h),translate(host.l)) <> 0 then
do
say host.l
hosts = hosts + 1
end
end
end
say hosts 'hosts found'


This will accept a list of full names or partial names and return the ones found in the stem.

Rob


-----Original Message-----
From: Ken MacKenzie <***@PRAMERICA.IE>
To: TSO-REXX <TSO-***@VM.MARIST.EDU>
Sent: Thu, Nov 12, 2015 2:04 pm
Subject: Re: REXX Upper case letter issue


There's no need for the second and third parameters. The default for

TRANSLATE is to convert to UPPER-CASE.

From REXX Reference manual:
If you
specify neither translation table and omit pad, string is simply
translated to
uppercase (that is, lowercase a?z to uppercase A?Z)

Ken MacKenzie
Pramerica
Systems Ireland Limited
is a private company limited by shares
incorporated
and registered in the Republic of Ireland with registered
number 319900
and
registered office at 6th Floor, South Bank House, Barrow Street,
Dublin 4,
Ireland.




From: "Farley, Peter x23353"
<***@BROADRIDGE.COM>
To: TSO-***@VM.MARIST.EDU,
Date:
12/11/2015 15:33
Subject: Re: [TSO-REXX] REXX Upper case letter
issue
Sent by: TSO REXX Discussion List
<TSO-***@VM.MARIST.EDU>



TRANSLATE(hostname, XRANGE('a', 'z'),
XRANGE('A', 'Z'))

You can make the XRANGE's a concatenation of a-I, j-r, s-z
if you want to
be totally accurate, but the single ranges should do for most
characters
that can be typed at a keyboard.

HTH

Peter

-----Original
Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On
Behalf
Of Mainframe Mainframe
Sent: Thursday, November 12, 2015 3:20 AM
To:
TSO-***@VM.MARIST.EDU
Subject: REXX Upper case letter issue

I am new in
Rexx and just trying to automate the host detail using this
rexx program.

In
this rexx I am expecting user to pass host name and then rexx will
fetch all
detail about that host.

The issue is that the input file from where the the
rexx fetch the detail
are in small letters. So, when we run the rexx and if
anybody type host
name in capital letter then rexx doesnt understand anythng
and gives me
error.

I checked in rexx online manual but dont have any
inbuilt function for
doing this task. Can you please help me solving this
issue.

--


This message and any attachments are intended only for the use
of the
addressee and may contain information that is privileged and
confidential.
If the reader of the message is not the intended recipient or an

authorized representative of the intended recipient, you are hereby
notified
that any dissemination of this communication is strictly
prohibited. If you
have received this communication in error, please
notify us immediately by
e-mail and delete the message and any attachments
from your
system.


----------------------------------------------------------------------
For
TSO-REXX subscribe / signoff / archive access instructions,
send email to
***@VM.MARIST.EDU with the message: INFO TSO-REXX



----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Paul Gilmartin
2015-11-13 14:51:57 UTC
Permalink
Raw Message
Post by Ken MacKenzie
There's no need for the second and third parameters. The default for
TRANSLATE is to convert to UPPER-CASE.
But the intent was to convert to lower case.
Post by Ken MacKenzie
From: "Farley, Peter x23353"
Date: 12/11/2015 15:33
TRANSLATE(hostname, XRANGE('a', 'z'), XRANGE('A', 'Z'))
-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Paul Gilmartin
2015-11-12 23:43:52 UTC
Permalink
Raw Message
Post by Farley, Peter x23353
TRANSLATE(hostname, XRANGE('a', 'z'), XRANGE('A', 'Z'))
You can make the XRANGE's a concatenation of a-I, j-r, s-z if you want to be totally accurate, but the single ranges should do for most characters that can be typed at a keyboard.
Or, you could try (untested):

translate( hostname, xrange( 'a', 'z' ), translate( xrange( 'a', 'z' ) ) )

... which should change only alphabetic characters.

(Why is it called "Xrange"? Since it's a range of characters, "Crange"
would be more appropriate.)

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Styles, Andy , SD EP zPlatform
2015-11-13 15:43:32 UTC
Permalink
Raw Message
But XRANGE doesn't only do alphabetic characters:

say c2x(xrange('I','J'))
C9CACBCCCDCECFD0D1

say x2c(c2x(xrange('I','J')))
I ôöòóõ}J

(on my screen in EBCDIC anyway).
--
Andy Styles

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Paul Gilmartin
Sent: 12 November 2015 23:44
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] REXX Upper case letter issue

-- This email has reached the Bank via an external source --
Post by Farley, Peter x23353
TRANSLATE(hostname, XRANGE('a', 'z'), XRANGE('A', 'Z'))
You can make the XRANGE's a concatenation of a-I, j-r, s-z if you want to be totally accurate, but the single ranges should do for most characters that can be typed at a keyboard.
Or, you could try (untested):

translate( hostname, xrange( 'a', 'z' ), translate( xrange( 'a', 'z' ) ) )

... which should change only alphabetic characters.

(Why is it called "Xrange"? Since it's a range of characters, "Crange"
would be more appropriate.)

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX


Lloyds Banking Group plc. Registered Office: The Mound, Edinburgh EH1 1YZ. Registered in Scotland no. SC95000. Telephone: 0131 225 4555. Lloyds Bank plc. Registered Office: 25 Gresham Street, London EC2V 7HN. Registered in England and Wales no. 2065. Telephone 0207626 1500. Bank of Scotland plc. Registered Office: The Mound, Edinburgh EH1 1YZ. Registered in Scotland no. SC327000. Telephone: 03457 801 801. Cheltenham & Gloucester plc. Registered Office: Barnett Way, Gloucester GL4 3RL. Registered in England and Wales 2299428. Telephone: 0345 603 1637

Lloyds Bank plc, Bank of Scotland plc are authorised by the Prudential Regulation Authority and regulated by the Financial Conduct Authority and Prudential Regulation Authority.

Cheltenham & Gloucester plc is authorised and regulated by the Financial Conduct Authority.

Halifax is a division of Bank of Scotland plc. Cheltenham & Gloucester Savings is a division of Lloyds Bank plc.

HBOS plc. Registered Office: The Mound, Edinburgh EH1 1YZ. Registered in Scotland no. SC218813.

This e-mail (including any attachments) is private and confidential and may contain privileged material. If you have received this e-mail in error, please notify the sender and delete it (including any attachments) immediately. You must not copy, distribute, disclose or use any of the information in it or any attachments. Telephone calls may be monitored or recorded.
Robert Garrett
2015-11-13 17:57:11 UTC
Permalink
Raw Message
Use this old assembler programmers trick, which takes advantage of the fact that in EBCDIC, the only difference between upper and lower case characters is the x'40' bit.
So...

_DATA = 'THIS.IS.UPPERCASE';

_LOWDATA = BITAND(_DATA,COPIES('10111111'b,LENGTH(_DATA))); /* This does the conversion, but also will mess up numerics plus the - and . characters, so to restore those... */
_LOWDATA = TRANSLATE(_LOWDATA,'0123456789.-',,
BITAND('0123456789.-',COPIES('10111111'b,12)),
); /* Translate the messed up versions of those characters back to the corresponding originals */

say _LOWDATA;

Yes, this transformation requires two statements when you could do the same thing with just one TRANSLATE as mentioned previously, but this method does have a 'cool' factor going for it.
(Note, this logic won't come CLOSE to working correctly on an ASCII system either...)

Rob

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Mainframe Mainframe
Sent: Thursday, November 12, 2015 2:20 AM
To: TSO-***@VM.MARIST.EDU
Subject: [TSO-REXX] REXX Upper case letter issue

I am new in Rexx and just trying to automate the host detail using this rexx program.

In this rexx I am expecting user to pass host name and then rexx will
fetch all detail about that host.

The issue is that the input file from where the the rexx fetch the detail are in small letters. So, when we run the rexx and if anybody type host name in capital letter then rexx doesnt understand anythng and gives me error.

I checked in rexx online manual but dont have any inbuilt function for doing this task. Can you please help me solving this issue.

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Loading...