INSPECT FIELD CONVERTING
'abcdefghijklmnopqrstuvwxyz' TO
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
I know it can also be done with inspect/replacing, but I "think" you would have to do each letter individually-not sure, though, so if any of you experts know, jump in-lol
confusedlady
If the function is intended to be used frequently in the pgm, I'd take both your approach and CL's approach and look at the generated assembler code or time each approach to determine which is faster.
To get the generated assembler language insructions listed in the compiler O/P, include options LIST,NOOFF as well as any others you may need.
I suspect that CL's would be more efficient, but a test would prove (or disprove) it.
I believe INSPECT CONVERTING is an IBM extension to the standard. INSPECT REPLACING, which is standard, can do the same thing although with much more verbiage. Also, in either case, one must specifically define the character set to be converted.
The intrinsic function UPPER-CASE doesn't suffer from that limitation and is standard (although I believe the intrinsic functions are an optional part of the standard, they are widely implemented) and therefore the one I'd go with.
I know you weren't answering any question I asked, but that was helpful info for me. Hope I remember next time I convert text case. Thanks! confusedlady
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.