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] Can FOCUS and Maintain pass data internally?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Can FOCUS and Maintain pass data internally?
 Login/Join
 
Virtuoso
posted
Ok, so here's a simplified example of something I want to do:

 
MAINTAIN FILE ENCOUNTER
CASE TOP
  stack clear StkEncounterSource;
  reposition encounter;
  for 10 next encounter.ENCOUNTER.ENCOUNTER_ID INTO StkEncounterSource;
  type StkEncounterSource.foccount;  
  type StkEncounterSource(10).Encounter_ID;
ENDCASE
END

-HTMLFORM BEGIN
<html>
<body>
  Hello World
</body>
</html>
-HTMLFORM END
  


I have a pretty deluxe focexec and I just got a requirement to have it make data changes mid-process. The code above functions as it appears it should -- the Maintain call works correctly and the mini-html page displays well.

Here's the question -- I want the Maintain code to give an OK signal to the FOCUS code that follows. I want the Maintain to be able to indicate error to the following focexec code so that it can branch appropriately. Is there an easy way to do that? Is there a way I can have the two chunks of code share a variable that I can use as a semaphore?

J.

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



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Expert
posted Hide Post
I think there are a couple of ways to do this.

1. TYPE ON DDNAME the result and -READ it in.
2. UPDATE a TABLE with the result, and TABLE it to check.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
Another approach, though Waz has given the main ones, is to use &INPUT, &CHNGD and &DELTD.

Only valid really if the logic in the MAINTAIN does some work or no work, usually accompanied with COMMIT and ROLLBACK logic.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Master
posted Hide Post
The TYPE ON DDNAME with a -READ is how I have done this in the past.

You could also EXEC the procedure from the Maintain and pass in variables, but this would mean that control is passed back to Maintain when it is done. You could just exit the Maintain from there though.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Virtuoso
posted Hide Post
Yeah, but that DDNAME is required to be static, right? Two people running this simultaneously could step on each other?

So I need to dynamically generate a name and then blow the thing away afterwards. Not exactly slick, but it will do the job.

quote:
Another approach, though Waz has given the main ones, is to use &INPUT, &CHNGD and &DELTD.


That's the kind of thing I was looking for. I was hoping I could just use sys_mgr.focset on an obscure setting and then query the value in the FOCUS code, but you can't query the value in the FOCUS code. There's no way to look at it in an automated way.

Oh well. Brute force. Use a file on the OS to pass one word two lines down in the same file. God bless Focus.

J.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Expert
posted Hide Post
You FILEDEF the file in the user's FOCCACHE session; it's unique to the user. It's removed at the end of the session.

Not an issue...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
Show me please. The help file was not clear and my attempts to do this failed in syntax (Win2003).

J.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Expert
posted Hide Post
FILEDEF MAINT_OUT DISK FOCCACHE/X_OUT.FTM (LRECL 10 RECFM F
-RUN
TYPE ON MAINT_OUT COMPLETE or INCOMPLETE
-RUN

then

-READ MAINT_OUT &MAINT_RC.A10.
-TYPE &MAINT_RC

then, branch accordingly on &MAINT_RC...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
As we say it in Baltimore, "THANK you . . ."

J.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Expert
posted Hide Post
Welcome...

Probably need double quotes around the values:

TYPE ON MAINT_OUT "COMPLETE"; or "INCOMPLETE";

If you just use a value, like "1" for complete, "2" for incomplete, make sure you modify the LRECL to the maximum value of the value you use...

  
FILEDEF MAINT_OUT DISK FOCCACHE/X_OUT.FTM (LRECL 1 RECFM F
-RUN
TYPE ON MAINT_OUT "1"; 
TYPE ON MAINT_OUT "2";
-RUN

-READ MAINT_OUT &MAINT_RC.A1.
-TYPE &MAINT_RC



Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 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     [SOLVED] Can FOCUS and Maintain pass data internally?

Copyright © 1996-2020 Information Builders