Sunday, August 14, 2016

Translating to Lowercase in REXX

Translate command in REXX by default converts the input string to upper case and returns the value. However, it is possible to convert to lowercase as well. Lets us see how shall we do that.

Syntax for translate command:

translate(input source, replace string, search string, padding)

Code example:

/*REXX*/

UPPERCASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'     
lowercase = 'abcdefghijklmnopqrstuvwxyz'     
input= 'HeLLO'

input_upper = translate(input, lowercase, uppercase)
Say 'Original Source  : ' input 
Say 'Translated Source: ' input_upper

This would return value 'hello' which will be stored in input_upper variable

3 comments:

  1. TRANSLATE is MAGIC!!

    http://rexxpertise.blogspot.com/2011/10/magic-of-translate.html

    ReplyDelete
  2. Thanks For sharing this Superb article.I use this Article to show my assignment in college.it is useful For me Great Work. Traductor Jurado Malaga

    ReplyDelete

Featured Post

REXX Skeleton: Submitting jobs through Rexx

Submitting jobs through REXX and reading the spool through REXX gives us immense potential to automate many manual activities in mainframes....