Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Update using MODIFY not working

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Update using MODIFY not working
 Login/Join
 
Guru
posted
I am trying to do a simple update of a flat file from another flat file but it does not seem to be working.
Please tell me what I am doing wrong.

Here is the main fex
MATCH.FEX
APP PATH TESTING

FILEDEF TMP_HOLD DISK \\WF_SERVERNAME\IBI\APPS\TESTING\TMP_HOLD.FTM
FILEDEF TMP_HOLD2 DISK \\WF_SERVERNAME\IBI\APPS\TESTING\TMP_HOLD2.FTM

MODIFY FILE TMP_HOLD
FIXFORM FROM TMP_HOLD2
MATCH COUNTRY CAR MODEL BODYTYPE
ON MATCH UPDATE SEATS
DATA ON TMP_HOLD2
END


Here is the master of the file I want to update
TMP_HOLD.MAS
FILE=TMP_HOLD       ,SUFFIX=FIX                                                 
SEGNAME=TMP_HOLD,SEGTYPE=S0                                                     
FIELDNAME   =COUNTRY            ,E01         ,A10      ,A10      ,$             
FIELDNAME   =CAR                ,E02         ,A16      ,A16      ,$             
FIELDNAME   =MODEL              ,E03         ,A24      ,A24      ,$             
FIELDNAME   =BODYTYPE           ,E04         ,A12      ,A12      ,$             
FIELDNAME   =SEATS              ,E05         ,I3       ,A03      ,$             


Here is the contents of the flat file I want to update
TMP_HOLD.FTM
ENGLAND   JAGUAR          V12XKE AUTO             CONVERTIBLE   0
ENGLAND   JAGUAR          XJ12L AUTO              SEDAN         0
ENGLAND   JENSEN          INTERCEPTOR III         SEDAN         0
ENGLAND   TRIUMPH         TR7                     HARDTOP       0


Here is the master of the file I want to update from
TMP_HOLD2.MAS
FILE=TMP_HOLD2       ,SUFFIX=FIX                                                
SEGNAME=TMP_HOLD2,SEGTYPE=S0                                                     
FIELDNAME   =COUNTRY            ,E01         ,A10      ,A10      ,$             
FIELDNAME   =CAR                ,E02         ,A16      ,A16      ,$             
FIELDNAME   =MODEL              ,E03         ,A24      ,A24      ,$             
FIELDNAME   =BODYTYPE           ,E04         ,A12      ,A12      ,$             
FIELDNAME   =SEATS              ,E05         ,I3       ,A03      ,$             


Here is the flat file I want to update from
TMP_HOLD2.FTM
ENGLAND   JAGUAR          V12XKE AUTO             CONVERTIBLE   9
ENGLAND   JAGUAR          XJ12L AUTO              SEDAN         9
ENGLAND   JENSEN          INTERCEPTOR III         SEDAN         9
ENGLAND   TRIUMPH         TR7                     HARDTOP       9


Here is the Webfocus output message
 (FOC415) TRANS     1 REJECTED  NOMATCH TMP_HOLD
 ENGLAND   JAGUAR          V12XKE AUTO             CONVERTIBLE   9
 (FOC415) TRANS     2 REJECTED  NOMATCH TMP_HOLD
 ENGLAND   JAGUAR          XJ12L AUTO              SEDAN         9
 (FOC415) TRANS     3 REJECTED  NOMATCH TMP_HOLD
 ENGLAND   JENSEN          INTERCEPTOR III         SEDAN         9
 (FOC415) TRANS     4 REJECTED  NOMATCH TMP_HOLD
 ENGLAND   TRIUMPH         TR7                     HARDTOP       9
 0 TRANSACTIONS:         TOTAL =     4  ACCEPTED=     0  REJECTED=     4
 SEGMENTS:             INPUT =     0  UPDATED =     0  DELETED =     0


Thanks,
Max

This message has been edited. Last edited by: Kerry,


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
Expert
posted Hide Post
quote:
MODIFY FILE TMP_HOLD
FIXFORM FROM TMP_HOLD2
MATCH COUNTRY CAR MODEL BODYTYPE
ON MATCH UPDATE SEATS
DATA ON TMP_HOLD2
END


Max,

Try this:
 
MODIFY FILE TMP_HOLD
FIXFORM FROM TMP_HOLD2
MATCH COUNTRY 
  ON NOMATCH INCLUDE 
  ON MATCH CONTINUE
MATCH CAR 
  ON NOMATCH INCLUDE 
  ON MATCH CONTINUE
MATCH MODEL
  ON NOMATCH INCLUDE 
  ON MATCH CONTINUE
MODEL BODYTYPE
  ON NOMATCH INCLUDE 
  ON MATCH UPDATE SEATS
DATA ON TMP_HOLD2
END


Hope this helps...

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
quote:
simple update of a flat file
Not using MODIFY you won't!! Check it out in the manuals.

Tom, I'm surprised that you missed that one Wink

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Guru
posted Hide Post
Thanks for the help Tom. I tried this.

MODIFY FILE TMP_HOLD
FIXFORM FROM TMP_HOLD2
MATCH COUNTRY 
  ON NOMATCH INCLUDE 
  ON MATCH CONTINUE
MATCH CAR 
  ON NOMATCH INCLUDE 
  ON MATCH CONTINUE
MATCH MODEL
  ON NOMATCH INCLUDE
  ON MATCH CONTINUE
MATCH BODYTYPE
  ON NOMATCH INCLUDE 
  ON MATCH UPDATE SEATS
DATA ON TMP_HOLD2
END


Basically it appended TMP_HOLD2.FTM to TMPHOLD.FTM. It did not update the records on TMP_HOLD2.FTM.
 (FOC1291) RECORDS AFFECTED DURING CURRENT REQUEST  : 4/INSERT
 0 TRANSACTIONS:         TOTAL =     4  ACCEPTED=     4  REJECTED=     0
 SEGMENTS:             INPUT =     4  UPDATED =     0  DELETED =     0


My syntax seems to be correct but there is something causing the match to reject records.
Both flat files are exact copies of each other the only difference is the SEATS field. Awaiting further guidance from the gurus.

Thanks,
Max


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
Guru
posted Hide Post
What data sources can you update using MODIFY?


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
Expert
posted Hide Post
Max,

MODIFY is for .foc(FOCUS) files with segment(s) and index(indices).

Not ftm's. Just overlay the previous ftm with the new one...

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Guru
posted Hide Post
I got it working with a .foc and a .ftm.
I had to create the computed field FOCLIST in the .ftm so that the match would work.

Thanks,
Max


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Update using MODIFY not working

Copyright © 1996-2020 Information Builders