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.
TABLE FILE CAR
PRINT
MODEL
SALES
DEALER AS 'DEALER'
RETAIL AS 'RETAIL'
COMPUTE BADCHAR/I6 = CHKFMT(6, SALES, '999999', 'I6') ;
-*
BY COUNTRY
BY CAR
ON TABLE SAVE
END
-RUN
-EXIT
And I get this error...
0 ERROR AT OR NEAR LINE 43 IN PROCEDURE sjustify.fexFOCEXEC * (FOC36355) INVALID TYPE OF ARGUMENT #2 FOR USER FUNCTION CHKFMT (FOC009) INCOMPLETE REQUEST STATEMENT BYPASSING TO END OF COMMAND -EXIT
CHKFMT checks each character, in a character string, for incorrect character types.
Here is a model of how it works:
APP PREPENDPATH IBISAMP
SET ONLINE-FMT = STANDARD
-RUN
DEFINE FILE CAR
CHARSTRING/A10 = DECODE COUNTRY ('JAPAN' '1234567890'
'ENGLAND' '123456 123'
ELSE 'ABC');
BADCHAR/I2 = CHKFMT(10, CHARSTRING, '999999999', BADCHAR);
ISANUMBER_YN/A1 = IF BADCHAR EQ 0 THEN 'Y' ELSE 'N';
END
TABLE FILE CAR
PRINT COUNTRY
CHARSTRING
BADCHAR
ISANUMBER_YN
END
Only Japan is flagged as a number:
COUNTRY CHARSTRING BADCHAR ISANUMBER_YN
------- ---------- ------- ------------
ENGLAND 123456 123 7 N
JAPAN 1234567890 0 Y
ITALY ABC 1 N
W GERMANY ABC 1 N
FRANCE ABC 1 N
CAR.SALES, in your example, is defined as an I6 in the MFD. Is this representative of the field you need to check?This message has been edited. Last edited by: David Briars,
-* File tomsweb9.fex
DEFINE FILE CAR
TOM/A10=DECODE COUNTRY(
'ENGLAND' '1234567890'
'FRANCE' '123 456'
'ITALY' 'ASDFG'
'JAPAN' '0'
ELSE '56');
END
TABLE FILE CAR
PRINT TOM
COMPUTE ISNUM/A1=IF TOM EQ '0' THEN 'Y' ELSE IF ATODBL(TOM,'10','D10') EQ 0 THEN 'N' ELSE 'Y';
BY COUNTRY
END
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
if the variable you want to check is an &var, then just &var.TYPE will produce either an A or an N. If an &var is all numbers, you'll get an N for its TYPE, no matter how you grabbed it.
&var.TYPE and &var.LENGTH are two handy characteristics
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
In the case where the CHKFMT function does not work, as when using the SQL1010 adapter, consider the use of the EDIT command.
The EDIT command returns a 0 (zero) if the field is not a numeric field and the numeric value if it is. then check that EDITed field for a zero (which is the value for an alpha field, GT zero is a numeric field.
I hope this helps someone, someday...
In FOCUS Since 1983 ~ from FOCUS to WebFOCUS. Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005
We don't use Oracle for starters, and I consult the MFD before writing any code, so I haven't had any reason to try this one. Nice to have in one's back pocket though ...