Bernie, Better still use: (FORMAT(.numtrans,'[-]0000')) For a positive or zero number this will return a 5 position text value but the blank will be at the end. for a negative number say -1941 this will return a 5 position text value 1941- If you format a number you must leave a place for the sign. there is no way around that fact. Normally the sign would preceed the return value. Houwever using the syntax above you can get the sign at the end.
Then when you use SPUT only move 4 places. Jim Bentley American Celiac Society --- Bernard Lis <[EMAIL PROTECTED]> wrote: > Javier, > Very Clever! That will do it, then I can use the > sput to get it into the > right place. > I was trying to do it with sput alone. > > Bernie Lis > ----- Original Message ----- > From: "Javier Valencia" > <[EMAIL PROTECTED]> > To: "RBG7-L Mailing List" <[email protected]> > Sent: Thursday, November 03, 2005 1:07 PM > Subject: [RBG7-L] - RE: format > > > > Bernie: > > Try: > > set var xtrans = > (SGET((format(.Numtrans,'0000')),4,2)) > > Javier, > > > > > > > > Javier Valencia, PE > > President > > Valencia Technology Group, L.L.C. > > 14315 S. Twilight Ln, Suite #14 > > Olathe, Kansas 66062-4578 > > Office (913)829-0888 > > Fax (913)649-2904 > > Cell (913)915-3137 > > ================================================ > > Attention: > > The information contained in this message and or > attachments is intended > > only for the person or entity to which it is > addressed and may contain > > confidential and/or privileged material. Any > review, retransmission, > > dissemination or other use of, or taking of any > action in reliance upon, > > this information by persons or entities other than > the intended recipient > > is prohibited. If you received this in error, > please contact the sender > > and > > delete the material from all system and destroy > all copies. > > > ====================================================== > > > > -----Original Message----- > > From: [email protected] [mailto:[EMAIL PROTECTED] > Behalf Of Bernard Lis > > Sent: Thursday, November 03, 2005 11:20 AM > > To: RBG7-L Mailing List > > Subject: [RBG7-L] - format > > > > How can I get format to return a 4 digit number > without a space for a > > sign? > > In the example below, xtrans is a 5 char text > value, I only want 4 char or > > it won't fit in the position I need it to go into. > > > > set var xtrans = (format(.Numtrans,'0000')) > > > > R>show var xtrans > > 2314 > > > > R>set var ln = ' ' > > > > R>set var ln = (sput(.ln,.xtrans,1)) > > > > R>show var ln > > 2314 > > > > 2314 actually is in positions 2 thru 5 > > > > Bernie Lis > > > > > > Jim Bentley American Celiac Society [EMAIL PROTECTED] tel: 1-504-737-3293 __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com
