Shmuel is correct..

test = 'abcdefghi';

X = substr(test,1,5);
 x = abcde

If you do a x = left(test,5); 

Regards,




Scott ford
www.identityforge.com

Tell me and I'll forget; show me and I may remember; involve me and I'll 
understand. - Chinese Proverb


On Sep 28, 2012, at 2:55 AM, "Hunkeler Peter (KIUP 4)" 
<[email protected]> wrote:

>> Shmuel is correct.
> 
> No, he's not.
> 
> My point was that with REXX you *can* do a substr(source,8,5) with a
> source shorter than 13 bytes and REXX will pad the 3 characters from the
> source with two blanks and *will assign* a 5 character string to the
> target (varchar) variable.
> 
> So,with REXX the statement  X = substr("1234567890", 8, 5) will assign
> the string "890  " (2 trailing blanks) to variable X.
> With PL/I, you get the compiler message I posted. 
> 
> NOTE that I did not say PL/I is wrong. I (indirectly) said Shmuel's
> statement was wrong.
> 
> I originally mentioned the REXX behavior and said that none of the other
> programming languages I know offers the same functionality.  It was in a
> reply to this statement where Shmuel sparsely replied: PL/I
> 
> --
> Peter Hunkeler
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to