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 &ECHO=ALL;
-* File modprob.fex
-DEFAULT &DB=SQLMSS
-*APP HOLD BASEAPP
-*TABLE FILE CAR
-*SUM SALES RETAIL_COST DEALER_COST
-*BY CAR BY MODEL
-*WHERE MODEL OMITS '2000'
-*ON TABLE HOLD AS MODPROB FORMAT &DB
-*END
-*-RUN
-*EX -LINES 2 EDAPUT ACCESS,MODPROB,C,FILE
-*SEGNAME=SEG01, TABLENAME=MODPROB, KEYS=0, WRITE=YES, $
-*-EXIT
-* 2
TABLE FILE CAR
SUM SALES RETAIL_COST
-*DEALER_COST
COMPUTE DEALER_COST/I2=2;
BY CAR BY MODEL
WHERE MODEL CONTAINS 'DOOR'
ON TABLE HOLD AS MODINP
END
-RUN
-* 3
MODIFY FILE MODPROB
FIXFORM FROM MODINP
MATCH *
ON NOMATCH INCLUDE
ON MATCH INCLUDE
DATA ON MODINP
END
-RUN
-* 4
TABLE FILE CAR
SUM SALES RETAIL_COST DEALER_COST
BY CAR BY MODEL
WHERE MODEL CONTAINS 'AUTO'
ON TABLE HOLD AS MODINP
END
-RUN
-* 5
MODIFY FILE MODPROB
FIXFORM FROM MODINP
MATCH *
ON NOMATCH INCLUDE
ON MATCH INCLUDE
DATA ON MODINP
END
Notes: 1. Create a database table. This is done once, then the ACX file is replaced for KEYS=0 and the KEYS in the database are deleted. 2. Create input to the table with a field having a wrong format. 3. When updating the table, you get an error. 4. Create a "good" input. 5. When updating the table, all records are rejected. See ECHO:
-* 2
TABLE FILE CAR
SUM SALES RETAIL_COST
-*DEALER_COST
COMPUTE DEALER_COST/I2=2;
BY CAR BY MODEL
WHERE MODEL CONTAINS 'DOOR'
ON TABLE HOLD AS MODINP
END
-RUN
0 NUMBER OF RECORDS IN TABLE= 12 LINES= 12
-* 3
MODIFY FILE MODPROB
FIXFORM FROM MODINP
MATCH *
ON NOMATCH INCLUDE
ON MATCH INCLUDE
DATA ON MODINP
END
-RUN
0 ERROR AT OR NEAR LINE 27 IN PROCEDURE modprob FOCEXEC *
(FOC437) THE FORMAT USED WITH FIXFORM IS INCOMPATIBLE WITH THE DATA FORMAT
BYPASSING TO END OF COMMAND
-* 4
TABLE FILE CAR
SUM SALES RETAIL_COST DEALER_COST
BY CAR BY MODEL
WHERE MODEL CONTAINS 'AUTO'
ON TABLE HOLD AS MODINP
END
-RUN
0 NUMBER OF RECORDS IN TABLE= 8 LINES= 8
-* 5
MODIFY FILE MODPROB
FIXFORM FROM MODINP
MATCH *
ON NOMATCH INCLUDE
ON MATCH INCLUDE
DATA ON MODINP
END
-RUN
0 WARNING.. ON MATCH INCLUDE INPUTS DUPLICATE SEGMENTS
0 TRANSACTIONS: TOTAL = 8 ACCEPTED= 0 REJECTED= 8
SEGMENTS: INPUT = 0 UPDATED = 0 DELETED = 0
However when all inputs are "good" then it works:
-* 2
TABLE FILE CAR
SUM SALES RETAIL_COST
DEALER_COST
-*COMPUTE DEALER_COST/I2=2;
BY CAR BY MODEL
WHERE MODEL CONTAINS 'DOOR'
ON TABLE HOLD AS MODINP
END
-RUN
0 NUMBER OF RECORDS IN TABLE= 12 LINES= 12
-* 3
MODIFY FILE MODPROB
FIXFORM FROM MODINP
MATCH *
ON NOMATCH INCLUDE
ON MATCH INCLUDE
DATA ON MODINP
END
-RUN
0 WARNING.. ON MATCH INCLUDE INPUTS DUPLICATE SEGMENTS
0 TRANSACTIONS: TOTAL = 12 ACCEPTED= 12 REJECTED= 0
SEGMENTS: INPUT = 12 UPDATED = 0 DELETED = 0
-* 4
TABLE FILE CAR
SUM SALES RETAIL_COST DEALER_COST
BY CAR BY MODEL
WHERE MODEL CONTAINS 'AUTO'
ON TABLE HOLD AS MODINP
END
-RUN
0 NUMBER OF RECORDS IN TABLE= 8 LINES= 8
-* 5
MODIFY FILE MODPROB
FIXFORM FROM MODINP
MATCH *
ON NOMATCH INCLUDE
ON MATCH INCLUDE
DATA ON MODINP
END
-RUN
0 WARNING.. ON MATCH INCLUDE INPUTS DUPLICATE SEGMENTS
0 TRANSACTIONS: TOTAL = 8 ACCEPTED= 8 REJECTED= 0
SEGMENTS: INPUT = 8 UPDATED = 0 DELETED = 0
Anybody has an idea how to circumvent this problem?
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
Danny - My first hunch is that after the "bad" transaction, your database or database connection is left in some sort of inconsistent state (and yes I know that's very vague).
What is your AUTOCOMMIT setting on your database connection? You could try doing something like this:
SQL SQLMSS SET AUTOCOMMIT ON FIN;
-* Do your 1st Modify
-* Check &FOCERRNUM. If 0 proceed to your next MODIFY. Otherwise do a rollback:
SQL SQLMSS
ROLLBACK [WORK] ;
END
-* Next, do you want to do your 2nd MODIFY even if the first fails? If so, go ahead.
-* Finally, when you're all done, do a commit:
SQL SQLMSS
COMMIT ;
END
If your first MODIFY fails because of the wrong format you could just set a flag. Use that to loop back to the code that recreates the database and from there to the second MODIFY - assuming you are always creating a new database each time.
But assuming you want the data from both passes why not just use a DEFINE to reformat the problematic DEALER COST right from the get go, which would ensure you don't have any incorrect data types at the MODIFY stage.