As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I have integer field (/I05)that may look like 00465 or 00010 or 01000 etc. I want to show this integer field as 465 or 10 or 1000. FTOA function changes it to alpha field and strip takes out the zeros but can someone show me how to use these 2 functions correctly so that only leading zeros will be taken out, please. Thanks in advance, KK
on VMS: OpenVMS AXP V8.2 Prod and TestEnvironment Webfocus: WebFocus 7.6.1 Prod and TestEnvironment
If just wanting output to surpess zeroes on the report, add an 'S', that is, PRINT FEILDI/I05S ...
Or is it that you want to convert it to an alpha field for some other reason, that is what FTOA is used for. Such as for concatenation to build a print line. I do that in a report here is an excerpt
TABLE FILE CAR
PRINT
SALES
COMPUTE SALESD/D6 = SALES; NOPRINT
COMPUTE SALESB/A9 = FTOA(SALES, '(D6)', 'A9');
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
END
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
thanks, but I was using FTOA exactly like in Francis's post was giving leading zeros. This is how mine looks like: I have 2 fields that are scores and codes and both are alpha fields. I converted the scores field into I05 first like this.
DEFINE FILE TEST scores/i05 = edit (scores); codea /a04 = if codea eq 'A' then scores else 0; codeb /a04 = if codea eq 'B' then scores else 0; END
TABLE FILE TEST SUM CODEA CODEB BY PID ON TABLE HOLD AS HOLD1 END
so that I get codea and codeb in one line for each ID.
TABLE FILE HOLD1 PRINT CODEA CODEB BY PID ON TABLE PCHOLD FORMAT HTML END
if codea is holding 00200 and codeb is 00030, I want these codea and codeb to just be showing 200 and 30. So I tried using strip? or something else? KK
on VMS: OpenVMS AXP V8.2 Prod and TestEnvironment Webfocus: WebFocus 7.6.1 Prod and TestEnvironment
Thanks Leah, but I need to convert it back to alpha because I want these scores to be a part of a string, like this:
STRING1 = NAME | CODEA | ',' | CODEB;
so that it will show
KK 220 10 etc.
so when converting it back to alpha from integer using FTOA gives me leading zeros and I need to stip off the leading zeros so that it will show like the above line and not like KK 00220 00010 etc.
on VMS: OpenVMS AXP V8.2 Prod and TestEnvironment Webfocus: WebFocus 7.6.1 Prod and TestEnvironment
Kind of reminds me of the mess I have to convert names properly when using LCWORD. You might be able to use something like this, of course, you'd have to watch for the fact that it was only leading characters you wanted to change.
FULXNAMA/A32 = LCWORD(32,FUL_NAME,FULXNAMA); I_IDX/I2 = IF FULXNAMA CONTAINS ' Mc' THEN POSIT(FULXNAMA,32,' Mc',3,I_IDX) ELSE 0; I_IDX2/I2 = I_IDX + 3; I_IDX3/I2 = I_IDX + 4; GETCHAR/A1 = IF I_IDX EQ 0 THEN ' ' ELSE SUBSTR (32,FULXNAMA,I_IDX2,I_IDX3,1,GETCHAR); NEWCHAR/A1 = UPCASE(1,GETCHAR,NEWCHAR); FULXNAMT/A32 = IF GETCHAR EQ ' ' THEN FULXNAMA ELSE OVRLAY(FULXNAMA,32,NEWCHAR,1,I_IDX2,FULXNAMT); I_IDXA/I2 = IF FULXNAMT CONTAINS ' Mac' THEN POSIT(FULXNAMT,32,' Mac',4,I_IDX) ELSE 0; I_IDXB/I2 = I_IDXA + 4; I_IDXC/I2 = I_IDXA + 5; GETCHARA/A1 = IF I_IDXA EQ 0 THEN ' ' ELSE SUBSTR (32,FULXNAMT,I_IDXB,I_IDXC,1,GETCHARA); NEWCHARA/A1 = UPCASE(1,GETCHARA,NEWCHARA); FULXNAMZ/A32 = IF GETCHARA EQ ' ' THEN FULXNAMT ELSE OVRLAY(FULXNAMT,32,NEWCHARA,1,I_IDXB,FULXNAMZ); I_IDX4/I2 = IF FULXNAMZ CONTAINS ' Iii' THEN POSIT(FULXNAMZ,32,' Iii',4,I_IDX4) ELSE 0; I_IDX5/I2 = I_IDX4 + 1; GETCHAR6/A3 = IF I_IDX4 EQ 0 THEN ' ' ELSE 'III'; FULXNAMW/A32 = IF GETCHAR6 EQ ' ' THEN FULXNAMZ ELSE OVRLAY(FULXNAMZ,32,GETCHAR6,3,I_IDX5,FULXNAMW); I_IDX6/I2 = IF FULXNAMW CONTAINS ' Ii' THEN POSIT(FULXNAMW,32,' Ii',3,I_IDX6) ELSE 0; I_IDX7/I2 = I_IDX6 + 1; GETCHAR7/A3 = IF I_IDX6 EQ 0 THEN ' ' ELSE 'II'; FULXNAME/A32 = IF GETCHAR7 EQ ' ' THEN FULXNAMW ELSE OVRLAY(FULXNAMW,32,GETCHAR7,2,I_IDX7,FULXNAME);
Leah
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004