RPG edit code for signed value

pts.
Tags:
Flat files
RPG Flat Files
RPG ILE
Hi I have moved a numeric value to a ds. I have used this EVAL F1 = %EDITC(ABC:'3')-here F1 is part of flat file DS and there are decimals required in the output file.I am getting the decimals but my problem is that ABC field from i/p file could be negative but am not sure how to get the sign to the flat file(ie the ds)

Answer Wiki

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

You haven’t indicated where you want the minus sign — assuming it’s left floating minus sign.
Edit code ‘P’ should do the trick

Discuss This Question: 5  Replies

 
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
  • eval ab=%editc(ABC:'P') will this work?
    0 pointsBadges:
    report
  • philpl1jb
    Yes, it works for me, does it work for you? This will surpress leading zero's and the minus will be on the left and it will have a decimal point so if ABC (7,2) = 57.21- ab = ' -57.21' Phil
    49,435 pointsBadges:
    report
  • I want the minus to be at the right extreme....
    0 pointsBadges:
    report
  • philpl1jb
    http://www.astradyne-uk.com/manuals/im012440.pdf page 71
    49,435 pointsBadges:
    report
  • Hey Phil thanks a lot for the ref material...was very helpful
    0 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