Zero Filled Integers

Bruce Easton bruce at stn.com
Tue Feb 27 07:20:24 PST 2007


Jay R. Ashworth wrote on Tuesday, February 27, 2007 12:20 AM:
>
> On Tue, Feb 27, 2007 at 12:13:55AM -0500, Kenneth Brody wrote:
> > Quoting J. Ryan Kelley (Mon, 26 Feb 2007 23:28:57 -0500):
> > > Is there an edit type to create zero filled integers?  I have an EDI
> > > transaction that requires that certain integer fields are zero filled.
> > > eg the value '600' in a 6 digit field would need to be passed as
> > > '0006000'.
> > >
> > > Filepro 5.0.13R4 on Solaris
> >
> > It comes with filePro.  I think it's called "0rj".  If you don't
> > have it, it's real simple:
> >
> >     0rj   \0\ {*}
> >
> > This will right-justify and zero-fill any value.
>
> Do you know what release that happened in, Ken?  Cause I remember quite
> clearly a) our having to do it ourselves) and b) it being a bitch that
> required separate edits for each length of field.
>
> Of course, other things I remember clearly aren't really true, so...  :-)
>

The edit that Mike Schwartz mentions called rj0 has been around
since 4.1 (second set of gray pages 12-18), along with "rj," "rjnum,"
and "rjminus."  If there was a different one called 0rj, I missed
that one - maybe that came out in 4.8?

I tried Ken's much simpler "0rj" above and the one that we have for
"rj0," which is:  [{ <0>!" "! }]  [{ # }]

and they behaved exactly the same for both direct data entry and for
the following processing posting tests on a field 1 with length
10 (with fp5.014):

1.
Then: ab(10,.0)="4"; 1=ab; end
Running rreport using this sets field 1 to "0000000004"

BUT

2.
Then: 1="4"; end
Running rreport using this sets field 1 to "         4"

So if you, for some reason need to assign literals to an rj0
field in processing and want zero padded results, remember to
use another intermediate field, as in #1 above, or do some
math as you as assigning as in:  1="0" + "4".  I don't think
I've had a need to do that so much as assignment to a dummy
field that needs the edit as in:  ab(10,rj0)="0" + "14".

Bruce

Bruce Easton
STN, Inc.






More information about the Filepro-list mailing list