Focal Point
conversion from packed to alphanumeric excluding the decimal point and comma.

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

February 28, 2007, 10:11 AM
manash
conversion from packed to alphanumeric excluding the decimal point and comma.
1) I have a packed field var1 of format P8.2.
I want to convert it to alphanumeric format of A7.
Ex var1= 12345.67
I want it as var2(A7)=1234567.
I want to eliminate the decimal point.
Any help?

I had used 'ftoa' function to convert from decimal to alpha but the problem is that i am getting comma. how to eliminate it?
Ex = 12,345


FOCUS 7.1.1/ MF(OS/390)
February 28, 2007, 10:18 AM
smiths
Look into PTOA. I'm pretty sure there were several posts previously on this.

Sean


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
February 28, 2007, 10:25 AM
BlueZone
Manash :
If nothing else works, this will...

DEFINE FILE CAR
FLD1/P8.2 WITH SALES = 12345.67;
FLD2/I8 = FLD1 * 100;
FLD3/A7=EDIT(FLD2,'$9999999');
END
TABLE FILE CAR
PRINT FLD1 FLD2 FLD3
WHERE READLIMIT EQ 1
WHERE RECORDLIMIT EQ 1
END


Gooooooooooood day !!
Sandeep Mamidenna


-------------------------------------------------------------------------------------------------
Blue Cross & Blue Shield of MS
WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL
MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !! Music
February 28, 2007, 10:28 AM
Danny-SRL
Hello Manash,

Try the following. Notice the small "c" if the format of the FTOA function.

VARL/D7=VAR1 * 100;
VAR2/A7=FTOA(VARL,'(D7c)','A7');

Daniel
www.srl.co.il


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

February 28, 2007, 11:12 AM
Alan B
Use PTOA.
P_Field/P8.2 = 12345.67;
A_Field/A7 = PTOA(P_Field*100,'(P7)','A7');

This will not cause you any issues.


Alan.
WF 7.705/8.007
February 28, 2007, 10:46 PM
manash
Thank you all for your valuable suggestions.


FOCUS 7.1.1/ MF(OS/390)
May 13, 2008, 12:22 PM
Ian Dalton
Using the FTOA with a small 'c' after the format ie. D15.2c will convert the long decimal no. without commas - ripper !!


_______________________
*** WebFOCUS 8.1.05M ***