I wish to concatenate a few strings into a string using RPG/400.
Some of the strings have ended with blanks. Can anyone suggest me a way as i fail to do it with CAT.
The strings line are:
I hope to join it becomes FB/ASPAC/ADHI/2008/0001 without any empty space in between.
I guess I can pick the low hanging fruit.
Code:variable1 *char 5 variable1 = 'ADHI ' mystring = 'FB' + '/' + 'ASPAC ' + '/' + %trim(variable1) + '/' + '2008' + '/' + '0001'
All my answers were extracted from the "Big Dummy's Guide to the As400"
and I take no responsibility for any of them.
if you are still stucking with RPGIII, try to add :0 to factor2.
An other way would be to use embedded SQL in your RPGIII program:PHP Code:
C MYVAR1 CAT MYVAR2:0 MYVAR3
C MYVAR3 CAT MYVAR4:0 MYVAR5
C+ SET MYRES = TRIM(MYVAR1) CONCAT TRIM(MYVAR2) CONCAT