View Full Version : removing leading seros from a character field
01-01-1995, 02:00 AM
whats the best way to remove leading zeros from a character field in order to concatenate a number into a string; eg: FIELDA = '0009' AND FIELDB = '0020' to get resulting string with 'Entry 9 of 20 in JOBQ' in RPGIV thanks, Mick.
05-18-2000, 09:25 AM
D fielda s 4 0 inz(0009) D fieldb s 4 0 inz(0040) D string s 30 C Eval String = %triml(%editc(fielda:'Z')) + C ' of ' + C %triml(%editc(fieldb:'Z')) + C ' in JOBQ' This is assuming that both fields are numeric. Work on my V4R4 box.
05-18-2000, 10:10 AM
move Charfield to numericfiled eval Charfield = %editc(numericfield:'Z')
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.