Focal Point
FOCUS : converting numeric (P13.2) to character(A10)

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1031012512

February 26, 2007, 01:55 AM
<Raghuraman>
FOCUS : converting numeric (P13.2) to character(A10)
Hi
i have field in focus like HFCURRSAL data type is P13.2.
I want display to A10 format.
Please how to solve this problem.
February 26, 2007, 02:33 AM
Alan B
Use the function PTOA

ALPHASAL/A10 = PTOA(HFCURRSAL,'(P13.2)','A10');

If the value in the P field is greater than can fit in the A field, the value is truncated from the right, i.e 1234567899.12 would become 123456789 . If you use '(P10.2)' and the value is greater *s are shown, which is safer.


Alan.
WF 7.705/8.007
February 26, 2007, 04:47 AM
manash
hi Alan,
Is there any way to convert from packed to decimal?
Ex- P13.2 to D10.2


FOCUS 7.1.1/ MF(OS/390)
February 26, 2007, 04:58 AM
Alan B
P to D conversion can be done directly.

DFIELD/D10.2=PFIELD;

As far as I am aware, on the windows platform P fields do not actually exist, so are held as D anyway. In the back of my mind I have a thought about unsigned packed fields causing an issue on mainframe.

It always helps to know your platform and version please manash.


Alan.
WF 7.705/8.007