[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading numeric fields from XML files



There's a C function called atoi() that would probably work. Note the H-specs, specifically DFTACTGRP and BNDDIR.

here's the code...(I have no idea how this will look to you so I apologize in advance if it's difficult to read/copy))

H dftactgrp(*no) actgrp(*caller) bnddir('QC2LE')
*
* Prototype of a c-function used to convert alpha to integer
D atoi pr 10i 0 extproc('atoi')
D str * value options(*string)
*.----------------------------------------------------------------+
D Char s 5 inz('55555')
D Numeric s 10 0
*.----------------------------------------------------------------+
/free

Numeric = atoi(Char);

dsply Numeric;

*inlr = *on;
return;

/end-free

Glenn Hopwood
Sr Programmer/Analyst
Electric Mobility
856-468-1000 x2545
Inactive hide details for llandreth@xxxxxxxxxllandreth@xxxxxxxxx


llandreth@xxxxxxxxx
Sent by: owner-ftpapi@xxxxxxxxxxxxx

10/31/2005 03:44 PM

Please respond to
ftpapi@xxxxxxxxxxxxx

To

<ftpapi@xxxxxxxxxxxxx>

cc


Subject

Reading numeric fields from XML files

Sender: llandreth@xxxxxxxxx


We went live today, sending XML orders to our vendor for the first time!!
Next, we will receive the shipping information back in XML as well.

Question:  A numeric field, say, order number, is 10 long.  However, only
the significant digits are sent and received, so order number 0000055555 is
returned as 55555.  Is there an  "elegant" way to put 55555 into a numeric
variable?     I suppose the vendor can return all 10 digits.   And yes,
MOVE will work, if the field is zero-filled first.   (I even tried to fool
the system and use %DEC, to no avail.)

Many thanks,

L. Landreth



-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------

GIF image

GIF image

GIF image