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]Using SET to create variable

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Using SET to create variable
 Login/Join
 
Platinum Member
posted
I am trying to use the SET command in Dialogue Manager to create two variables, StartDate and EndDate that I will use in a number of reports/processes/etc in a process flow. My code currently is:

-SET StartDate = &&StartDate
-SET EndDate = &&EndDate

I get an error that says "(FOC295) A VALUE IS MISSING FOR: &&StartDate." I'm thinking, "Well, yeah, that's the point. I want to SUPPLY the value." So why am I not being prompted to enter a date? I am new to WF, so sorry this is such a basic request. I tried searching these forums, but nothing I can see addresses this.

This message has been edited. Last edited by: T.Peters,


WebFOCUS: 7702
O/S : Windows
Data Migrator: 7702
 
Posts: 127 | Location: San Antonio | Registered: May 29, 2009Report This Post
Expert
posted Hide Post
You are missing the leading ampersands in front of your -SET variables. It should be:
-SET &StartDate=&&StartDate
-SET &EndDate=&&EndDate

Also the error is in relation to &&StartDate which is a global variable and should have been set prior to the focexec beginning. It cannot be prompted for.

What are you actually trying to do?


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Platinum Member
posted Hide Post
I want to create two variables that I can use multiple times down the procedure. I am probably going to have 7-8 reports in the stack that all run for the same date range. I will then store the output of these reports into a HOLD file and query all the hold files and combine them into a final report.


WebFOCUS: 7702
O/S : Windows
Data Migrator: 7702
 
Posts: 127 | Location: San Antonio | Registered: May 29, 2009Report This Post
Virtuoso
posted Hide Post
quote:
Well, yeah, that's the point. I want to SUPPLY the value.


The you should have something like:

-DEFAULTS &StartDate =  your_default_start_date_here;
-DEFAULTS &EndDate   =  your_default_end_date_here;


Only if you need those variables to be globally accessed you'd prefix them with a double ampersand.

But to Ginny's point, what exactly do you want to do? That way we can make more informed suggestions leaving the "guess" factor out of the equation.

- Neftali.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
quote:
I want to create two variables that I can use multiple times down the procedure

As long as everything happens within the procedure (by actual code in it or through the use of -INCLUDE) you should be fine by just using &StartDate and &EndDate. Global variables would not be applicable in this case.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Platinum Member
posted Hide Post
njsden, I dont really want a DEFAULT parameter to use, I want to prompt the user to input a date that will be globally assigned. I want to reuse that variable in multiple reports.


WebFOCUS: 7702
O/S : Windows
Data Migrator: 7702
 
Posts: 127 | Location: San Antonio | Registered: May 29, 2009Report This Post
Platinum Member
posted Hide Post
Hi,

You can use the following code to force a prompt:

This is for a text field
  
-PROMPT &USERNUM.A9.Please enter your Employee Nubmer


This is for a dropdown
  
-PROMPT &STORECODE.(B10,B20,B30,B40).Please select a Store.


Hope this helps.

Best Regards,

Jimmy Pang


DEV: WF 7.6.10
TEST: WF 7.6.10
PROD: WF 7.6.10
MRE: WF 7.6.4
OS/Platform: Windows
Dev Studio: WF 7.7
Output: HTML, EXCEL, PDF, GRAPH, LOTUS, CSV
 
Posts: 117 | Location: Toronto, Ontario, Canada | Registered: February 29, 2008Report This Post
Platinum Member
posted Hide Post
quote:
Originally posted by fatboyjim:
Hi,

You can use the following code to force a prompt:

This is for a text field
  
-PROMPT &USERNUM.A9.Please enter your Employee Nubmer


This is for a dropdown
  
-PROMPT &STORECODE.(B10,B20,B30,B40).Please select a Store.


Hope this helps.

Best Regards,

Jimmy Pang


Jimmy, that looks close to what I'm looking for. When I implement that, though, I get "EDA NO DATA." Is something missing? Should I be pointing to a data source or something?

EDIT: I changed the code to read
-PROMPT &StartDate.'Please enter Start Date(YYYYMM)'.A6
-PROMPT &EndDate.'Please enter End Date(YYYYMM)'.A6

This seems to work, I get the prompt I want and I can enter the date. I still need to see if I can actually USE it now.


WebFOCUS: 7702
O/S : Windows
Data Migrator: 7702
 
Posts: 127 | Location: San Antonio | Registered: May 29, 2009Report This Post
Expert
posted Hide Post
You really don't need to use the -PROMPT. If the variable appears anywhere in the focexec, it will be prompted for with the autoprompt screen depending on your autoprompt setting in the client console.

In your case, you would want to create a nice launch page with calendar controls for the start and end dates.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Platinum Member
posted Hide Post
quote:

In your case, you would want to create a nice launch page with calendar controls for the start and end dates.


Ginny, I thought of doing that too. How can I save the output of the control to the variable?


WebFOCUS: 7702
O/S : Windows
Data Migrator: 7702
 
Posts: 127 | Location: San Antonio | Registered: May 29, 2009Report This Post
Platinum Member
posted Hide Post
Hi,

If that's all in the program, then you will not get anything.
If that is the only thing that you want to do in the program, I suggest making a HTML page displaying a message about parameters saved.

Since you want to use this multiple times, you may want to save it into a file.
I think you can do a -WRITE command (do a search would be best for examples).

-WRITE filename [NOCLOSE] text

  
-WRITE SAVEDPARM &SDATE.A6. &EDATE.A6.


And then you can use the -READ command to extract it back out.
Not sure if this is the best idea or if there are any issues with it, but you can give it a try.

Best Regards,

Jimmy Pang


DEV: WF 7.6.10
TEST: WF 7.6.10
PROD: WF 7.6.10
MRE: WF 7.6.4
OS/Platform: Windows
Dev Studio: WF 7.7
Output: HTML, EXCEL, PDF, GRAPH, LOTUS, CSV
 
Posts: 117 | Location: Toronto, Ontario, Canada | Registered: February 29, 2008Report This Post
Expert
posted Hide Post
To answer your question, T, about linking the control to the variable, this is something very easy to do with the HTML Composer. Since you already have your focexec written and it has amper variables in it, you will create a new page using the HTML Composer. Once in the tool, add a button to the page. Open the Hyperlink properties. create a reference for the button pointing to an 'external procedure', and point to your program. You can then choose to create or not create a form. I choose the latter. When you close out of that, your controls are automatically put on the page. You can then switch to the parameters view and customize the controls to be dates and they should already be tied to the amper variables in your program.

I think this is what you meant by saving the control output to a var. Please correct me if I'm wrong or if I need to give you more information.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Platinum Member
posted Hide Post
So, are you saying create an HTML form completely detached from the procedure stack I'm building and use the button to call the stack using the dates on the calendar control? That makes sense.

When I was trying to do this, I was putting an HTML object inside the stack and trying to figure out how to extract the value from the control.


WebFOCUS: 7702
O/S : Windows
Data Migrator: 7702
 
Posts: 127 | Location: San Antonio | Registered: May 29, 2009Report This Post
Expert
posted Hide Post
I must be getting old...

What do you mean by Procedure Stack ?


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
Expert
posted Hide Post
We're all getting old!

I'm just *guessing* the group of entities in the Procedure Viewer is the Procedure Stack???


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Oh Yeah, that makes sense.

Then the post I did to the other thread should be quite easy, all in one fex.


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
Platinum Member
posted Hide Post
What would be a more "accepted" term for that which would make more sense to the broader community?


WebFOCUS: 7702
O/S : Windows
Data Migrator: 7702
 
Posts: 127 | Location: San Antonio | Registered: May 29, 2009Report This Post
Expert
posted Hide Post
Program or focexec for 'procedure stack'. HTML page or launch page for the other. But I knew what you meant. Smiler


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Platinum Member
posted Hide Post
quote:
Originally posted by GinnyJakes:
Program or focexec for 'procedure stack'. HTML page or launch page for the other. But I knew what you meant. Smiler


I'll use that in the future then.


WebFOCUS: 7702
O/S : Windows
Data Migrator: 7702
 
Posts: 127 | Location: San Antonio | Registered: May 29, 2009Report 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]Using SET to create variable

Copyright © 1996-2020 Information Builders