I've strung together TLE mapping commands to manipulate numbers many times,
but life is too short.  If your familiar with unix it is much easier to use
a user exit like the one attached.

In the script attached, the translator passes an implied decimal (N2) in a
store field "PRICE" the script returns an explicit decimal back in the same
store field.  You can expiriment with the print statement to add the leading
zeros etc.

Put the script in $EDIH/xlate/bin and make it executable.  To test it create
a file call it anything put one line in the file like this,

PRICE=2500

Run the script passing the file name as a parameter. After it runs, the file
will contain,

PRICE=25.00


To run this from the map
store value into PRICE
add PRICE to user exit parameter list
call user exit
the store field PRICE will now contain the explicit decimal




-----Original Message-----
From: Test, Brian
To: [EMAIL PROTECTED]
Sent: 4/17/01 7:47 AM
Subject: Mapping Challenge

Hi All,

Once again I need to draw upon your expertise.  I need your help with
regards to taking an amount field in the SAC segment (856 document), and
having it be formatted in such a way that it satisfies our applications
format requirement.  My translator is a Harbinger 4.1/Unix version.

This is what should be sent to us on the SAC segment:

If freight charge is $25.12 the segment will look like:
SAC*C*D240***2512

If freight charge is $25.00 the segment will look like:
SAC*C*D240***2500

My application record should have the translated field look like
00025.12
(leading zeros are required)

My problem is that when I do a translation, I can not get the leading
zeros,
since the translator justifies to the left.  Any suggestions?

Thanks again,
Brian Test
E-Commerce Analyst
ACCO North America
300 Tower Parkway
Lincolnshire, IL 60069-3640
(800) 222-6462 x3973
(847) 419-4146 FAX
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>

"WorldSecure" made the following
 annotations on 04/17/01 06:43:21
------------------------------------------------------------------------
------

[INFO] -- Virus Manager:
This message was scanned with Network Associates Viper,
and no viruses were detected.

========================================================================
======

=======================================================================
To contact the list owner:  mailto:[EMAIL PROTECTED]
Archives at http://www.mail-archive.com/edi-l%40listserv.ucop.edu/



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

setdecimal_exit.sh

Reply via email to