Focal Point
[SOLVED] Update using MODIFY not working

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9631035403

October 29, 2008, 12:57 PM
Mighty Max
[SOLVED] Update using MODIFY not working
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
October 29, 2008, 01:05 PM
Tom Flynn
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
October 29, 2008, 01:18 PM
Tony A
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 
October 29, 2008, 01:21 PM
Mighty Max
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
October 29, 2008, 01:26 PM
Mighty Max
What data sources can you update using MODIFY?


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
October 29, 2008, 01:59 PM
Tom Flynn
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
October 29, 2008, 06:33 PM
Mighty Max
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