November 18, 2009, 10:59 PM
YangyangAbout Trim spaces
the code:
-SET &YY = 'TEST ';
-SET &YYTEST= TRIM('B', '&YY.EVAL', &YY.LENGTH, ' ', 1, 'A&YY.LENGTH');
the result :
-TYPE &YYTEST ;
aslo displays: 'TEST '
how to trim the trailing spaces ?
Thanks,
Yang
November 18, 2009, 11:40 PM
WazUsing the logic you have this will work.
-SET &YY = 'TEST ';
-SET &YYLEN = ARGLEN(&YY.LENGTH,&YY,'I2') ;
-SET &YYTEST= TRIM('T',&YY, &YY.LENGTH, ' ', 1, 'A&YYLEN.EVAL');
-TYPE '&YY';
-TYPE '&YYTEST';
But I would use
-SET &YYTEST = TRUNCATE(&YY);
November 19, 2009, 12:17 AM
YangyangThanks Waz.
it's fixed.
Thank you very much!