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.
SET PF12=RETURN MODIFY FILE NAMETAB COMPUTE REPLY/I1=; PFKEY/A4=;
CRTFORM LINE 3 NOCLEAR " OPTION 1 -- ADD A NEW NAME TO THE TABLE " " NAME (2 POS. EX. AB OR BC ) . MATCH NM ON MATCH TYPE "NAME ON MATCH REJECT ON NOMATCH INCLUDE
The name value needs to checked.. The valid name values are : AB BC CD XY YZ If the name value is not any one of the above it has to send an error.
Hope I'm clear..This message has been edited. Last edited by: Poryes,
Use VALIDATE, or IF ... GOTO, to impose the edit rule (returning to the crtform if an invalid value is entered).
For instance VALIDATE name/I1=NAME IN ('AB', ..., 'YZ'); or IF NOT (NAME IN ('AB', ..., 'YZ')) GOTO ...; or COMPUTE ErrMsg/A40=IF NAME IN ('AB', ..., 'YZ') THEN '' ELSE 'Invalid NAME'; IF ErrMsg NE '' GOTO ...; ( and show in the crtform )
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
I tried with IF NOT (NAME IN ('AB', ..., 'YZ')) GOTO ...;
Below is my code, SET PF12=RETURN MODIFY FILE NAMETAB COMPUTE REPLY/I1=; PFKEY/A4=; . . . .
CASE OPTION1 COMPUTE CRTFORM LINE 3 NOCLEAR " OPTION 1 -- ADD A NEW NAME TO THE TABLE " " NAME (2 POS. EX. AB OR BC ): IF NOT (NM IN ('AB' OR 'BC' OR 'CD' OR 'XY OR 'YZ')) GOTO OPTION1; I'm getting below error message. (FOC774) THE WORD 'IN' MUST APPEAR IN A VALID CLAUSE
Pls Help..
Ps: Even I tried with IF NOT NM IN ('AB' OR 'BC' OR 'CD' OR 'XY OR 'YZ') GOTO OPTION1; But same error.
Try something like this (didn't test it, I don't have the old modify crtform capability any more):
SET PF12=RETURN
MODIFY FILE NAMETAB
COMPUTE REPLY/I1=;
PFKEY/A4=;
MSG/A50=;
....
CASE OPTION1
CRTFORM LINE 3 NOCLEAR
" OPTION 1 -- ADD A NEW NAME TO THE TABLE "
" NAME (2 POS. EX. AB OR BC ): <NM"
" <D.MSG>"
COMPUTE MSG = 'SORRY, NEW NAME MUST BE AB, BC, CD, XY OR YZ.';
IF 'AB-BC-CD-XY-YZ' OMITS NM THEN GOTO OPTION1;
COMPUTE MSG=' ';
...
ENDCASE
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
GamP - I tried with below code getting the error message.
COMPUTE CRTFORM LINE 3 NOCLEAR "OPTION 1 -- ADD A NEW NAME TO THE TABLE " "STATE (2 POS.EX.OR WA) . :"" COMPUTE MSG = 'SORRY, NEW NAME MUST BE AB, BC, CD, XY OR YZ.'; IF 'AB-BC-CD-XY-YZ' OMITS NM THEN GOTO OPTION1; COMPUTE MSG=' '; *
Error Message: (FOC282) RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD: MDIF::::
Yeah, that's fine, but remember that it has to be of a format that can hold the message put in to it. 25 characters isn't that much, and if you took the code from my example it needs at least 45 characters.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
Then it must be something else that's causing the problem. Since I don't have the CRTFORM capability anymore I ended up coding a small modify without it, but with the validation logic:
FILEDEF OUT DISK NAMTAB.MAS
-RUN
-WRITE OUT FILENAME=NAMTAB, SUFFIX=FOC, $
-WRITE OUT SEGNAME=NAMTAB, SEGTYPE=S1, $
-WRITE OUT FIELDNAME=NM, FORMAT=A2, $
-RUN
MODIFY FILE NAMTAB
COMPUTE MSG/A45=;
FIXFORM NM/2
PERFORM OPTION1
CASE OPTION1
COMPUTE MSG = 'SORRY, NEW NAME MUST BE AB, BC, CD, XY OR YZ.';
IF 'AB-BC-CD-XY-YZ' CONTAINS NM THEN GOTO ENDCASE;
TYPE "<NM - <MSG"
ENDCASE
DATA
AB
AC
AD
AE
XY
XZ
END
See if you can run this code without a problem. On my system I can.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007