Jim,
Ok, I'll give this a try. Here's what I would do to get a currency
variable to a text value without the leading space and no decimal:
set var gross curr = 35,123.45
set var ftax curr = 2,345.56
SET VAR agrs TEXT = (LJS(FORMAT(.gross*100,"00000000000"),11))
SET VAR atax TEXT = (LJS(FORMAT(.ftax*100,"00000000000"),11))
I've used it when I need to send data to a mainframe. Seems to
work. Hope this helps.
Duey
Date sent: Wed, 12 Dec 2001 16:34:12 -0500
Subject: Re: picture format problem 6.5++ dos
From: "James (Jim) Bentley" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Send reply to: [EMAIL PROTECTED]
> Bernard,
>
> Try following:
> set var agrs = (format(.igrs,"[-]00000000000"))
>
> This will still give you a 12 character field but the space
> will be on the right.
>
> You then can use the LN2 syntax below to accomplish what
> you wish.
>
>
> --
> Jim Bentley
> American Celiac Society
> [EMAIL PROTECTED] - email
> (973) 776-3900 x5029 - voicemail/fax
>
>
>
> ---- "Bernard Lis" <[EMAIL PROTECTED]> wrote:
> > In the following code, I want to put 2 currency amounts
> > into a text line, right justified and zero filled. The
> > fields are 11 spaces each.
> > The first amount should go into 1 thru 11 and the second
> > amount should go into 12 thru 22.
> >
> > However, it seems that the format function is putting a
> > sign field in front of the digits and therefore truncating
> > the last digit.
> >
> > Anyone know how I can eliminate the extra space in front
> > of the amounts?
> >
> > set echo on
> >
> > set var gross curr = 35,123.45
> >
> > set var ftax curr = 2,345.56
> >
> > set var igrs int = (.gross * 1000/10)
> >
> > set var itax int = (.ftax * 1000/10)
> >
> > set var agrs = (format(.igrs,"[>]00000000000"))
> >
> > set var atax = (format(.itax,"[>]00000000000"))
> >
> > set var ln = " "
> >
> > set var ln = (sput(.ln,.agrs,1))
> >
> > set var ln = (sput(.ln,.atax,12))
> >
> > set var ln2 = " "
> >
> > set var ln2 = (smove(.agrs,1,11,.ln2,1))
> >
> > set var ln2 = (smove(.atax,1,11,.ln2,12))
> >
> > write .ln
> >
> > write .ln2
> >
> > set var ln3 = " "
> >
> > set var ln3 = (smove("ABCDE",1,5,.ln3,1))
> >
> > set var ln3 = (smove("fghij",1,5,.ln3,6))
> >
> > write .ln3
> >
> > set echo off
> >
> > return
> >
> >
>
> __________________________________________________
> FREE voicemail, email, and fax...all in one place.
> Sign Up Now! http://www.onebox.com
>
> ================================================
> TO SEE MESSAGE POSTING GUIDELINES:
> Send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: INTRO rbase-l
> ================================================
> TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] In
> the message body, put just two words: UNSUBSCRIBE rbase-l
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Duey Heffelfinger, Director of Computer Services +
+ E-mail: [EMAIL PROTECTED] Dana College +
+ Phone : 402-426-7289 2848 College Drive +
+ Blair, Nebraska 68008 +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ If you can dream it, it can come true! +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l