Bashing Packed Value

Issue #2 closed
Former user created an issue

I am having trouble with something in xmlservice. I am trying to pass a 20p0 field back in a webservice via xmlservice, and it bashing my value... the simple answer might just be that packed decimal doesn't support a 20p0 definition... but my rpg programs are working fine with that. In the RPG program you see it is 12345678901234567890. In the result you can see that I am getting a different value.

This is the RPG program.(TESTPGM)

H AlwNull(*UsrCtl)

D p1 S 20p 0
C Entry PLIST
C PARM p1
/free
p1 =
12345678901234567890;
inlr = *on;
return;
/end-free

Here is the XMLService script... simple test...

<html> <body> <h1>Secure call XMLSERVICE please</h1> <form id="myForm" name="myForm" action="http://urltoMachine/QXMLSERV/XMLCGI.pgm" method="post"> <input type="hidden" name="db2" value="C101313D"> <br>User: <input type="input" name="uid" value="USERID"> <br>Password: <input type="password" name="pwd" value="PASSWD"> <input type="hidden" name="ipc" value="na"> <input type="hidden" name="ctl" value="here"> <br>XML Input: <br><textarea readonly name="xmlin" rows="20" cols="100"><?xml version='1.0'?> <xmlservice> <pgm name='TESTPGM' lib='XMLSERVICE'> <parm io='both'><data type='20P0'></data></parm> </pgm> </xmlservice> </textarea> <input type="hidden" name="xmlout" value="512000"> <br><input type="submit" name=submit" value="submit" /> </form> </body> </html>

My response is the following

<xmlservice> <pgm name="TESTPGM" lib="XMLSERVICE"> <parm io="both"> <data type="20P0">12345678901234567000</data> </parm> <success> <![CDATA[ +++ success XMLSERVICE TESTPGM ]]> </success> </pgm> </xmlservice>

Comments (6)

  1. Former user Account Deleted

    Appears to be conversion error/truncation after 12345678901234567(000), I will look into when i have moment. I suspect fairly easy solution, probably check for 'max digits' beyond current limit and use a different converter, or, maybe replace current converter.

    BTW -- Aaron helped me set bitbucket email notification, so, in theory, i should see issues/comments faster (cross fingers).

  2. Former user Account Deleted

    Btw -- packed decimal is commonly used for dollars, so, 20p0 appears a unlikely test of reality. That is to say, national debt is $18,159,732,202,749, trillions fits xmlservice. Appears you live in very rich place at $12,345,678,901,234,567,890 ... perhaps from Ferengi Alliance (Star Trek)???

  3. Former user Account Deleted

    Actually, i may not fix this, i can't think of anything in the universe that measures in uints approaching quintillion or much less quadrillion (burgers sold, seconds, zip codes, social security numbers, nothing). This issue appears to be a simple exercise, and, i have better things to do. However, if you have a real use for this max size number, please post, otherwise i will close this issue.

  4. Former user Account Deleted

    One last feed back before i delete the issue. You can't practically use numbers like quintillion or much less quadrillion in scripting languages in any other way than 'string'. It is true, some esoteric extensions can add/subtract 'strings', but usage is so clunky, slow and impracticable that very few real scripts use the services. In end, for practicality, most everyone lives within natural limits/conversions around applications that fit reality (real world).

    I will add your quintillion/quadrillion observation to list of things for a future version, but, until so practical example exists, this will remain a low value request.

    BTW -- If you are marketing/agent of another 'toolkit' company, looking to do a little viral marketing, please stay off this message board, it is intended for people with real world problems.

  5. Log in to comment