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     Modify - single segment file question

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Modify - single segment file question
 Login/Join
 
Guru
posted
Hi,

I'm not the greatest at MODIFY processing. Okay, what I got is a single segment focus db. What I need to do is match on the key fields then, ON NOMATCH INCLUDE, then ON MATCH, check one of the fields to see if that field matches the input file, if it does, then REJECT. If it doesn't, then update that field and update a timestamp field.

So, I started with something like this:
DEFINE FILE INFILE
STAMP1/HYYMDs=HGETC(8,STAMP1);
END
TABLE FILE INFILE
PRINT FIELD1
      STAMP1
BY    KEYFIELD1
BY    KEYFIELD2
ON TABLE SET ASNAMES ON
ON TABLE HOLD
END
-RUN
MODIFY TESTFILE
FIXFORM FROM HOLD
MATCH KEYFIELD1 KEYFIELD2
ON NOMATCH INCLUDE
ON MATCH

... not sure what to say here... 
    something to the effect of
    IF FIELD1 FROM HOLD = FIELD1 FROM TESTFILE
       THEN REJECT
    ELSE
       UPDATE FIELD1 STAMP1

END


I tried it this way and it didn't work. I think it's because FIELD1 is on the same segment as the keyfields not a child segment, so the second MATCH won't work...

MATCH KEYFIELD1 KEYFIELD2
ON NOMATCH INCLUDE
ON MATCH CONTINUE
MATCH FIELD1
ON NOMATCH UPDATE FIELD1 STAMP1
ON MATCH REJECT
END


That particular code gives me a (FOC411) THE ACTION AFTER 'ON NOMATCH' IS INVALID: UPDATE error.

I'm on 7.1.4.

Thanks for the assistance.


WF 8.1.05 Windows
 
Posts: 333 | Location: Orlando, FL | Registered: October 17, 2006Report This Post
Virtuoso
posted Hide Post
Anatess,

  
DEFINE FILE INFILE
STAMP1/HYYMDs=HGETC(8,STAMP1);
END
TABLE FILE INFILE
PRINT FIELD1
      STAMP1
BY    KEYFIELD1
BY    KEYFIELD2
ON TABLE SET ASNAMES ON
ON TABLE HOLD
END
-RUN
MODIFY TESTFILE
FIXFORM FROM HOLD
MATCH KEYFIELD1 KEYFIELD2
ON NOMATCH INCLUDE
ON MATCH IF FIELD1 EQ D.FIELD1 THEN GOTO TOP;
ON MATCH UPDATE STAMP1
DATA ON HOLD
END


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, 2006Report This Post
Expert
posted Hide Post
Anatess,

Because it is a single segment file, what Danny suggests above will work perfectly. However, if you ever encounter a multiple segment file then you might need to use -
VALIDATE field[/format] = expression;
ON VALID action
ON INVALID action

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
Virtuoso
posted Hide Post
Anatess,

Tony's addendum is to the point. Also, by using the VALIDATE command you can also type out some comments about rejected input records.

I think I was a bit elliptic in my example. To be a bit more explicit, in MODIFY any field name - in your example FIELD1 - is interpreted by MODIFY as coming from the input - in your example the HOLD file. In order to access the same field in the database - the FOCUS file - you add the D. prefix to the field name - D is a mnemonic for Database.

I hope this makes the subject clearer.


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, 2006Report This Post
Guru
posted Hide Post
Danny, Tony,
You guys are the best! Your proposed solution worked perfectly.

Side note: I posted a question on the Microsoft discussion group on some such and it's been almost 2 weeks and the only response I got was - are you sure this is what you want to do? Sigh.

I love Focal Point!


WF 8.1.05 Windows
 
Posts: 333 | Location: Orlando, FL | Registered: October 17, 2006Report 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     Modify - single segment file question

Copyright © 1996-2020 Information Builders