Trim Data on field in RPG

390 pts.
Tags:
RPG
RPG Data Fields
RPG debugging
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • BigKat
    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
    8,220 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following