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:
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
March 29, 2010, 11:39 AM
GinnyJakes
You are missing the leading ampersands in front of your -SET variables. It should be:
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.
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
March 29, 2010, 11:50 AM
njsden
quote:
Well, yeah, that's the point. I want to SUPPLY the value.
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.
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
March 29, 2010, 12:02 PM
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.
-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
March 29, 2010, 12:13 PM
GinnyJakes
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.
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
March 29, 2010, 01:05 PM
fatboyjim
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.
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.
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
March 29, 2010, 04:32 PM
Waz
I must be getting old...
What do you mean by Procedure Stack ?
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
March 29, 2010, 04:40 PM
Francis Mariani
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
March 29, 2010, 04:47 PM
Waz
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.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
March 30, 2010, 10:11 AM
T.Peters
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
March 30, 2010, 10:16 AM
GinnyJakes
Program or focexec for 'procedure stack'. HTML page or launch page for the other. But I knew what you meant.