In my program, there is a 6 digit numeric field that I want to display with an edit word. when the filed contains 081450, I want it to display as 08.14.50. What %editw bif would do that
Announcement
Collapse
No announcement yet.
Edit word needed
Collapse
X
-
It's an idiosyncrasy of edit words, Greg. Edit words suppress leading zeros by default. To turn off zero suppression, you begin the edit word with a zero. However, this adds one byte to the result. The substring throws away the unneeded first byte.
Comment
-
Yeah, the editw was kinda quirky. I was beating my head against the wall. Thanks for the helpOriginally posted by TedHolt View PostIt's an idiosyncrasy of edit words, Greg. Edit words suppress leading zeros by default. To turn off zero suppression, you begin the edit word with a zero. However, this adds one byte to the result. The substring throws away the unneeded first byte.
Comment
-
Just in case you were discussing date data types, this would probably be a more elegant solution:
If this does not apply to you, then it's possible someone else may stumble on this thread looking for ways to handle non-standard date separators.Code:dcl-s mdyDate date(*mdy.); // the . at the end of the date format is the seperator dcl-s charDate char(8); mdydate = %date(); charDate = %char(mdyDate); *inlr = *on; return;
Comment
-
As with all things - there is more than one way to skin the proverbial cat...
Todate will have 08.14.50.Code:dcl-s fromdate zoned(6) inz(081450); dcl-s Todate Char(8); dcl-s Datewrk Date; Datewrk = %Date(FromDate:*MDY); ToDate = %Char(DateWrk:*MDY.);
Comment






Comment