View previous topic :: View next topic
|
Author |
Message |
honestsoul
New User
Joined: 05 Nov 2008 Posts: 23 Location: delhi
|
|
|
|
Hi,
i want to convert a variable which is in capslock by default to small letter
for example : EDBIKRT
out should be :edbikrt
ANY REXX FUNCTION for it??? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
No, you need to write your own:
Code: |
/* REXX CVTLOWER */
Parse Arg string
upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
lower = 'abcdefghijklmnopqrstuvwxyz'
low_string = Translate(string, lower, upper)
Return low_string
|
|
|
Back to top |
|
|
honestsoul
New User
Joined: 05 Nov 2008 Posts: 23 Location: delhi
|
|
|
|
thanks superk
actually i am passing the value through a variable its a big program...
just before the output i need to change the capital letter value to small letter...
The below code just calling the variable. and i just want the &CFIL variable to b in small letter its comming in capital.
locsite pri=5 cy sec=1 cy u=prodda rec=fb lr=300 blocksi=0
get &CFIL..txt 'WGTP.NONX.WGT0&CN.R.&CS..GRPTAPE(+1)'
rename &CFIL..txt &CFIL..old |
|
Back to top |
|
|
honestsoul
New User
Joined: 05 Nov 2008 Posts: 23 Location: delhi
|
|
|
|
Hi,
also,i want to write 8 length value starting from 73 column and ending in column 80.
the ouput should be:
73 80
MOPK 00010000
Note:73 and 80 are the column position. not the output value. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Kevin provide a function to convert to lower case. Just add it to the bottom of your larger exec, but add a label:
Code: |
/* REXX CVTLOWER */
CVTLOWER:
Parse Arg string
upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
lower = 'abcdefghijklmnopqrstuvwxyz'
low_string = Translate(string, lower, upper)
Return low_string |
And just when you need to change case, do something like this:
Code: |
CFIL = cvtlower(CFIL)
|
although, your example looks suspiciously like CLIST rather than rexx. The solution Kevin provide is REXX. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
like CLIST rather than rexx |
looks more like FTPese to me |
|
Back to top |
|
|
|