Decimal Question
Edis, Bob
BEdis@usbnc.org
Wed, 27 Feb 2002 12:22:54 -0600
The reason I used the right justified example is that most .DAT files are
going to be imported into some other application and is probably NOT comma
delimited. If you tell the import program that bytes 34 to 42 represents a
numeric value but there are trailing spaces the record or field will be
rejected.
On the other hand if you right justify, zero fill there will never be any
spaces and the value can always be interpreted as numeric. I did miss the
sign issue though.
Blue
-----Original Message-----
From: Pickering, John (NORBORD) [mailto:PICKERIJ@norbord.com]
Sent: Wednesday, February 27, 2002 12:15 PM
To: 'Jones Allen (Van)'; PowerHouse List (E-mail)
Subject: RE: Decimal Question
Correct.
So I'll revise my suggestion to the following if there value can be
negative:
>define d-amount char*10 &
> = ascii(floor(amount of yourfile / 100)) + "." &
> + ascii(mod(abs(amount of yourfile),100))
Regards,
JWP
> -----Original Message-----
> From: Jones Allen (Van) [SMTP:Allen.Jones@vpgroup.com]
> Sent: Wednesday, February 27, 2002 1:04 PM
> To: PowerHouse List (E-mail)
> Subject: RE: Decimal Question
>
> Actually the ascii function returns the sign on the left, but you need to
> allow for it.
>
> -----Original Message-----
> From: Pickering, John (NORBORD) [mailto:PICKERIJ@norbord.com]
> Sent: Wednesday, February 27, 2002 9:56 AM
> To: PowerHouse List (E-mail)
> Cc: 'aarnone@grey.com'
> Subject: RE: Decimal Question
>
>
> Bob's answer will give you a right justified and zerofilled result.
>
> Here's one that gives a left justified unfilled result:
>
> >define d-amount char*10 &
> > = ascii(floor(amount of yourfile / 100)) + "." &
> > + ascii(mod (amount of yourfile , 100))
>
> Regards,
> JWP
>
>
> > -----Original Message-----
> > From: Edis, Bob [SMTP:BEdis@usbnc.org]
> > Sent: Wednesday, February 27, 2002 12:14 PM
> > To: PowerHouse List (E-mail)
> > Subject: RE: Decimal Question
> >
> > Use a float data type (d_famount FLOAT = iamount / 100) to convert value
> > to
> > an CHAR data type and insert the decimal point (e.g. d_camount CHAR*9 =
> > ASCII(iamount,8)[1:6] + '.' + ASCII(iamount,8)[7:2]
> >
> > Blue
> >
> > -----Original Message-----
> > From: Arnone, Anthony [mailto:aarnone@grey.com]
> > Sent: Wednesday, February 27, 2002 10:51 AM
> > To: powerh-l@lists.swau.edu
> > Subject: Decimal Question
> >
> >
> > I have a numeric field called amount that is stored in the database
> > without
> > the decimal placement. (i.e. $100.00 = 10000) I need to write this field
> > to
> > a subfile with the nodictionary parameter including the decimal point so
> > in
> > the file it looks like 100.00. Any Ideas? I am running 8.19 on MPE i/X.
> > Also
> > can someone explain when I append to a subfile with the nodictionary
> > parameter I need to hit the return key for it to process or else it
> would
> > do
> > nothing and just hang there.
> >
> > Anthony
> >
> >
>
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe" in message body to
powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.