Here's my example (I couldn't find the equivalent to %subarr(), so it uses pop. I should have used sys.argv[1:].):
https://archive.midrange.com/midrange-l/201901/msg00405.html
Here's John Yeung's code:
https://archive.midrange.com/midrange-l/201901/msg00408.html
-----Original Message-----
From: Jim Oberholtzer [mailto:midrangel@xxxxxxxxxxxxxxxxx]
Sent: Thursday, January 24, 2019 10:21 AM
To: 'Midrange Systems Technical Discussion' <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: [EXTERNAL] Need help to convert a name in upper case, to mixed case
I have followed this thread with interest, and aside from "python can do that" and some examples of how to use python from various places, no one really answered the question in the original post.
What would the python code look like to convert a name in all upper case to mixed case?
It occurs to me that the "titlecase()" might do it.
"capitalize" might be an alternative based on the use case.
So if the name is in string "s", then:
s.captialize()
or
s.titilecase() or s.title()
so:
s = "JIM OBERHOLTZER";
print s.capitalize()
Results in "Jim Oberholtzer". It does what the original post was asking about.
--
Jim Oberholtzer
Agile Technology Architects
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Justin Taylor
Sent: Wednesday, January 23, 2019 8:57 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: [EXTERNAL] Need help to convert a name in upper case, to mixed case
Almost certainly the performance would be worse than an ILE call. Whether it's enough to make a real difference would depend on the totality of your circumstances.
-----Original Message-----
From: Rob Berendt [mailto:rob@xxxxxxxxx]
Sent: Wednesday, January 23, 2019 6:09 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: [EXTERNAL] Need help to convert a name in upper case, to mixed case
I've pretty much stopped following this thread but this last post was germane to the original posters question.
In this last post John Yeung states that one should think of calling a PASE based language, like Python, as akin to calling something on another system.
Not at all like the interaction between ILE languages.
If this is true, then I would question the performance.
While you would not have the unreliability of using an external service (as per a recent thread) you might still have the overhead.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.