Has anybody had experience good / bad with striping decimal places from an input field that is being mapped to a webMethods Mainframe packed decimal field.
wM MF requires the input to a packed decimal field (with impled decimal places) as a whole number. Eg. Mainframe transaction field for a packed decimal with 2 decimal places inputting “10.00” needs to be passed in as “1000”
I’m just after a best approach to doing this and seeing if anybody has had any issues with implementing this in a webMethods service.
Actually on the mainframe the number may be stored without a decimal but to display it you use a mask (ie. PIC 999v99). The v indicates where the decimal point should be located on the display. The data over the wire to webMethods will not include any indication of where the decimal point should be. When you send the data to your recieving application - that application can also be written to apply a display mask to the data or store it as a floating point number or a double.
If you are manipulating the data in webMethods before you send it to your recieving application, you will have to treat it as an integer until your recieving application can apply the mask.
I don’t think you should have any issues with this. Let me know if you have any other mainframe related problems.
There is more to creating a packed decimal than stripping the decimal point. Each byte of a packed decimal holds two digits. The last byte holds one digit and a sign value. You’ll need to convert the string value holding “10.00” to a byte array with the proper packing.
To expand a little more on this, on the MF, the packed dec. value 12.34, would be stored in memory in 3 bytes containing the values 01 23 4F, with no indication of the decimal location. The dec. location is assigned using a mask, as stated before, at the time the value is used in a program.