365 pts.
 Trim Data on field in RPG
Hi I am writing a program to FTP the data from our system to another service provider. I have created one field length of 680 In my RPG program I have a data structure combine about 63 fields into one field. The problem i am having is that when a field is let's say 20 long and I need to trim the blanks off that field '12345 .' The next time that field has the following :' 12 ' In my combined fields I have a separator eg 123 ,12 , How can Iget rid of the leading blanks Devan

Software/Hardware used:
ASKED: May 18, 2009  12:49 PM
UPDATED: May 19, 2009  4:54 PM

Answer Wiki:
The %trim function will remove leading and trailing spaces from character fields Fld1 = %trim(MyFld1) Not sure if that will help with your data structure. Phil
Last Wiki Answer Submitted:  May 18, 2009  1:25 pm  by  philpl1jb   44,150 pts.
All Answer Wiki Contributors:  philpl1jb   44,150 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

a data structure implies fixed positioning into a string i.e.

00001AAAAA     =  1 and "AAAAA"
00002b         =  2 and "b    "

if you need to trim and separate, you will probably want to do some thing like

eval   output = %trim(fld1) + ',' + %trim(%editc(fld2:'Z'))

Kevin – Affiliated

 7,185 pts.