My requirement is: I need to concatenate different fields having different values into the flat-string(blank initially), separated by a number of blanks(spaces), which may vary from field to field.
MyStr = 'FIRST_NAME LAST_NAME 20060101 STREET1 CITY11 STATE111 ... ' and so on
where MyStr = Flat String, FIRST_NAME, LAST_NAME, 20060101 etc., are my field-values which i need to concatenate to MyStr.
please note that FIRST_NAME & LAST_NAME are seperated exactly by 10-spaces and LAST_NAME & 20060101 are seperated exactly by 5-spaces, STREET1 & CITY11 are seperated exactly by 3-spaces etc., which will vary fld to fld.
Iam using free-format RPG & if I use a work var to loop through & concatenate each field as below
WrkStr = ' ';
WrkStr = WrkStr + Fname;
MyStr = WrkStr;
and when i finally move this WrkStr into Mystr as above, to my surprise i don't see anything in MyStr(i.e. it's blank). Iam not getting what to do.
Thanks in Advance