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'm trying to update a row in a FOC file. Below is my code:
TABLE FILE rv_getequipmentcommentsasobjectarray_ws PRINT LINECODE EQUIPMENTGROUPCODE UNITNUMBER STARTDATETIME/HYYMDS UPDATEDATETIME COMMENTS SYMPTOM PROBLEM ACTION SOLUTION BY LINECODE NOPRINT BY EQUIPMENTGROUPCODE NOPRINT BY UNITNUMBER NOPRINT BY STARTDATETIME NOPRINT
&WHR_TODATE1 ON TABLE HOLD AS EQPCMT END
USE D:\ibi-qa\ibi\apps_srv\sample\focfile.foc END
MODIFY FILE focfile FIXFORM FROM EQPCMT MATCH LINECODE EQUIPMENTGROUPCODE UNITNUMBER STARTDATETIME ON MATCH UPDATE COMMENTS SYMPTOM PROBLEM ACTION SOLUTION DATA ON EQPCMT END -RUN
If I output the data on the EQPCMT hold file, I get data that looks okay. See sample below:
The linecode, equipmentgroupcode and unitnumber are readable but the startdatetime looks garbled. I have 181 rows to update and all of them got REJECTED. Is there something I missed?
Thanks for the help.
Dev: WebFOCUS 7.6.10, Data Migrator 7.6.10 QA: WebFOCUS 7.6.10, Data Migrator 7.6.10 Prod: WebFOCUS 7.6.2, Data Migrator 7.6.8 Windows 2K3, Tomcat 5.5.17, IIS 6 Usage: HTML, PDF, Excel, Self-serve, BID and MRE
Posts: 197 | Location: Roseville, CA | Registered: January 24, 2005
I tried your suggestion but it did not work. It still rejected all the rows. I'm expecting the exact number of rows to be modified since the information is already in the file.
It just occured to me that focfile is actually an XFOCUS file. We need that to be due to the data that we need. The output size for focfile is 2.91 GB.
It looks like your focus database that you're modifying is a result of a HOLD FORMAT FOCUS request and not a real Focus Database that was created with the CREATE command. It has a field called FOCLIST which is created with the HOLD FORMAT FOCUS file. If you need to make this a real Focus Database, eliminate FOCLIST from the master and CREATE your file with CREATE FILE FILENAME (back up your file first)
Then try to modify.
Good Luck!
WebFOCUS 7.6.6/TomCat/Win2k3
Posts: 428 | Location: Springfield, MA | Registered: May 07, 2003
I tried your suggestion and it still did not work. I need FOCLIST (as a key) to delete records later in the code. We are doing implementing FIFO on this object. The requirement is to keep 35 days of data. Since it takes 1+ hour to run, we initialize it with 35 days and have a daily job that gets daily data and appends to the file and delete the oldest data from the file (36th day).
I used that CAR file in this example to show the code. What am I doing wrong? I simply want to change the bodytype and seats for ENGLAND TRIUMPH TR7 HARDTOP 2 to SOFTTOP 5. Here's the code and the MAS file for the foc file.
MAS File: Note the format is XFOCUS FILENAME=CAR_FOC , SUFFIX=XFOC , $ SEGMENT=SEG01, SEGTYPE=S1, $ FIELDNAME=FOCLIST , ALIAS=E01, USAGE=I5, $ FIELDNAME=COUNTRY, ALIAS=E02, USAGE=A10, $ FIELDNAME=CAR, ALIAS=E03, USAGE=A16, $ FIELDNAME=MODEL, ALIAS=E04, USAGE=A24, $ FIELDNAME=BODYTYPE, ALIAS=E05, USAGE=A12, $ FIELDNAME=SEATS, ALIAS=E06, USAGE=I3, $
FEX: -* File test_carfoc.fex
-SET ECHO=ALL;
-SET &MAXLIST = 0;
TABLE FILE CAR PRINT COMPUTE CNT/I5 = CNT + 1 ; COMPUTE FOCLIST/I9=&MAXLIST + CNT ; COUNTRY CAR MODEL BODYTYPE SEATS ON TABLE HOLD AS HOLD1 END
TABLE FILE HOLD1 PRINT FOCLIST COUNTRY CAR MODEL BODYTYPE SEATS ON TABLE HOLD AS HOLD2 END
USE D:\ibi-dev\ibi\apps_srv\dan_test\car_foc.foc NEW END
CREATE FILE car_foc
MODIFY FILE car_foc FIXFORM FROM HOLD2 DATA ON HOLD2 END
TABLE FILE CAR_FOC PRINT * END
DEFINE FILE CAR DEF_BT/A12 = 'SOFTTOP'; DEF_S/I3 = 5; END
TABLE FILE CAR PRINT COUNTRY CAR MODEL DEF_BT DEF_S WHERE COUNTRY EQ 'ENGLAND'; WHERE CAR EQ 'TRIUMPH'; WHERE MODEL EQ 'TR7'; ON TABLE HOLD AS HOLD3 FORMAT ALPHA END
USE D:\ibi-dev\ibi\apps_srv\dan_test\car_foc.foc END
MODIFY FILE car_foc FIXFORM COUNTRY/10 CAR/16 MODEL/24 FIXFORM BODYTYPE/12 SEATS/3 MATCH COUNTRY CAR MODEL ON MATCH UPDATE BODYTYPE SEATS DATA ON HOLD3 END -RUN
TABLE FILE CAR_FOC PRINT * END
-EXIT
Thanks,
Dev: WebFOCUS 7.6.10, Data Migrator 7.6.10 QA: WebFOCUS 7.6.10, Data Migrator 7.6.10 Prod: WebFOCUS 7.6.2, Data Migrator 7.6.8 Windows 2K3, Tomcat 5.5.17, IIS 6 Usage: HTML, PDF, Excel, Self-serve, BID and MRE
Posts: 197 | Location: Roseville, CA | Registered: January 24, 2005
Here's a snippet of the source from the above code:
0 NUMBER OF RECORDS IN TABLE= 1 LINES= 1 0 ERROR AT OR NEAR LINE 82 IN PROCEDURE ADHOCRQ FOCEXEC * (FOC439) WARNING. A MATCH CONDITION HAS BEEN ASSUMED FOR: FOCLIST (FOC415)TRANS 1 REJECTED NOMATCH SEG01 ENGLAND TRIUMPH TR7 SOFTTOP 5 0 TRANSACTIONS: TOTAL = 1 ACCEPTED= 0 REJECTED= 1 SEGMENTS: INPUT = 0 UPDATED = 0 DELETED = 0 TABLE FILE CAR_FOC PRINT * END -EXIT 0 NUMBER OF RECORDS IN TABLE= 18 LINES= 18
Dev: WebFOCUS 7.6.10, Data Migrator 7.6.10 QA: WebFOCUS 7.6.10, Data Migrator 7.6.10 Prod: WebFOCUS 7.6.2, Data Migrator 7.6.8 Windows 2K3, Tomcat 5.5.17, IIS 6 Usage: HTML, PDF, Excel, Self-serve, BID and MRE
Posts: 197 | Location: Roseville, CA | Registered: January 24, 2005
You are getting the error because you have forgotten that FOCLIST is your Key Field. You need to have a value for and then MATCH on FOCLIST in order to update the record.
Your code could also be much simpler but that is a separate issue.
Posts: 140 | Location: Adelaide South Australia | Registered: October 27, 2006
I've updated the MAS file to make it a FOCUS format and removed the key on FOCLIST, no other keys. I ran the FEX and it worked. The row got updated.
Is there a limitation with the XFOCUS format. I did the same this with a XFOCUS format and no keys? It did not update the row. I need to use XFOCUS since the data we are keeping is close to 3GB.
Dev: WebFOCUS 7.6.10, Data Migrator 7.6.10 QA: WebFOCUS 7.6.10, Data Migrator 7.6.10 Prod: WebFOCUS 7.6.2, Data Migrator 7.6.8 Windows 2K3, Tomcat 5.5.17, IIS 6 Usage: HTML, PDF, Excel, Self-serve, BID and MRE
Posts: 197 | Location: Roseville, CA | Registered: January 24, 2005
The number of keys is determined by the SEGTYPE parameter. e.g SEGTYPE=S! means the first field named in the segment is the key, S2 means the first 2 fields named make up the key and so on. You can create the segment with as many key fields as you need to create a unique identifier by setting the SEGTYPE to the correct value and putting the key fields first in the MAS file.
Posts: 140 | Location: Adelaide South Australia | Registered: October 27, 2006
Thanks for the note. I created a case with IBI yesterday on updating XFOCUS files. I was able to re-create the issue with the CAR file and hopefully can get a response from them soon.
Thanks,
Dev: WebFOCUS 7.6.10, Data Migrator 7.6.10 QA: WebFOCUS 7.6.10, Data Migrator 7.6.10 Prod: WebFOCUS 7.6.2, Data Migrator 7.6.8 Windows 2K3, Tomcat 5.5.17, IIS 6 Usage: HTML, PDF, Excel, Self-serve, BID and MRE
Posts: 197 | Location: Roseville, CA | Registered: January 24, 2005
If you need FOCSORT for the update and your file is an S1 (like OPALTOSH explained) One little trick you can try is to match on the non key fields also.
Your code should say
MATCH FOCSORT ON MATCH UPDATE whatever
or....
MATCH FOCSORT nonkey1 nonkey2 nonkey3 ON MATCH update whatever
You were trying to match on the non key fields and omitted the key field from the request.
Good Luck!
WebFOCUS 7.6.6/TomCat/Win2k3
Posts: 428 | Location: Springfield, MA | Registered: May 07, 2003
in my experience, FOCLIST field is created not because of HOLD FORMAT FOCUS but because of the use of the PRINT verb rather than a SUM verb when tableing to make that HOLD FORMAT FOCUS. just fyi.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
Thanks to all who replied. IBI techsupport helped me resolved it. Here's the code I got from them:
-SET &MAXLIST = 0;
TABLE FILE CAR PRINT COMPUTE CNT/I5 = CNT + 1 ; COMPUTE FOCLIST/I9=&MAXLIST + CNT ; COUNTRY CAR MODEL BODYTYPE SEATS ON TABLE HOLD AS HOLD1 END -RUN
TABLE FILE HOLD1 PRINT FOCLIST COUNTRY CAR MODEL BODYTYPE SEATS ON TABLE HOLD AS HOLD2 END CREATE FILE CARFOC -RUN
MODIFY FILE CARFOC FIXFORM FROM HOLD2 DATA ON HOLD2 END -RUN
TABLE FILE CARFOC PRINT * END -RUN
DEFINE FILE CARFOC DEF_BT/A12 = 'SOFTTOP'; DEF_S/I3 = 5; END TABLE FILE CARFOC PRINT FOCLIST COUNTRY CAR MODEL DEF_BT DEF_S WHERE COUNTRY EQ 'ENGLAND'; WHERE CAR EQ 'TRIUMPH'; WHERE MODEL EQ 'TR7'; ON TABLE SAVE AS SAVE03 END -RUN
MODIFY FILE CARFOC FIXFORM FOCLIST/5 COUNTRY/10 CAR/16 MODEL/24 FIXFORM BODYTYPE/12 SEATS/3 MATCH FOCLIST ON NOMATCH REJECT ON MATCH UPDATE BODYTYPE SEATS DATA ON SAVE03 END -RUN
TABLE FILE CARFOC PRINT * END
We did a diffent approach to use FOCLIST as the key when we update and was able to hurdle the problem with are having with the MATCH. After running the MATCH command, it says it update X number of rows. When we do a TABLE file for that row, it was indeed updated but prefixed with a 6 digit random (not sure it it is) number.
For example, before the MATCH, the comments field for FOCLIST 1 is "This is just a test". After the MATCH, it became "000074This is just a test". Fields that are blank have random 6 digit number and originally blank fields have been updated to 000512
Dev: WebFOCUS 7.6.10, Data Migrator 7.6.10 QA: WebFOCUS 7.6.10, Data Migrator 7.6.10 Prod: WebFOCUS 7.6.2, Data Migrator 7.6.8 Windows 2K3, Tomcat 5.5.17, IIS 6 Usage: HTML, PDF, Excel, Self-serve, BID and MRE
Posts: 197 | Location: Roseville, CA | Registered: January 24, 2005
Pls. disregard my earlier post. The problem has been resolve. We have a field that is of format A512V. This caused our MATCH process to slow down and append the random number in front of the text. We created a define field with format A512 and assigned the field (A512V). The update worked fine!
Thanks for all your help!
Dev: WebFOCUS 7.6.10, Data Migrator 7.6.10 QA: WebFOCUS 7.6.10, Data Migrator 7.6.10 Prod: WebFOCUS 7.6.2, Data Migrator 7.6.8 Windows 2K3, Tomcat 5.5.17, IIS 6 Usage: HTML, PDF, Excel, Self-serve, BID and MRE
Posts: 197 | Location: Roseville, CA | Registered: January 24, 2005