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     How do I create a Define with a amper variable?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
How do I create a Define with a amper variable?
 Login/Join
 
Member
posted
I am able to create an amper variable, that prompts me for a part number. But I also want it to prompt for any number, then multiply my number by a column in the table.

Here is my code so far.

It prompts me for a part without a problem.
But I need to know how to also prompt for a number, then take the number and multiply it by the field quantity_required, and display the new quantity based on the prompted value.

TABLE FILE BOMPRDST
BY PART_NUMBER
BY QUANTITY_REQUIRED
BY COMPONENT_PART_NUMBER
WHERE PART_NUMBER EQ '&PART_NUMBER';
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL2K
END


7.64, Windows, Excel
 
Posts: 6 | Registered: September 24, 2008Report This Post
Gold member
posted Hide Post
Here is an example,

DEFINE FILE CAR 
VALEUR/I5 = (&RANDOM * SEATS );
END 
TABLE FILE CAR
PRINT
SEATS 
VALEUR
WHERE COUNTRY EQ 'ENGLAND';
END 


Hope this helps


PROD: WebFOCUS 7.1.0 on Linux/Tomcat 5.5.12 (standalone)/Informix on AIX
TEST: WebFOCUS 7.1.3 on Linux/Tomcat 5.5.16 (standalone)/Informix on AIX
 
Posts: 53 | Location: Montreal,Quebec,Canada | Registered: February 13, 2006Report This Post
Member
posted Hide Post
Sorry, but this isn't helping. I will try to explain better.

I think I need a define statement, but maybe I don't. Maybe I am doing this all wrong.

Bascally, I have a table with three columns.
Column A = Master Part number
Column B = component part number
Column C = quantity of component part number

I want to be able to prompt for multiple master part numbers, and for each master part number prompt for a quantity.

The prompted quantity will be multiplied by the component quantity.

The report will need to display the Master Part number, the component part number, the component quantity, and the calculation of the prompted quantity times the component quantity.


7.64, Windows, Excel
 
Posts: 6 | Registered: September 24, 2008Report This Post
Platinum Member
posted Hide Post
quote:
DEFINE FILE CAR
VALEUR/I5 = (&RANDOM * SEATS );
END


You'll need to define as follows:

DEFINE FILE BOMPRDST
V_CALC/I10 = &QTY_PROMPT * QTY_COMPONENT;
END

You could also do the same in COMPUTE within the table request.
This should be done in conjunction with the filter which you have already used.

This should solve your problem.

Rock On!
Syed


Using WF 7.1.7/Dev Studio
 
Posts: 189 | Location: Boston, MA | Registered: July 12, 2005Report This Post
Member
posted Hide Post
I guess my problem was I do not need to do a define, just a compute. Now I need to know how to do multi selects. Is there a way to select five different part numbers, and each part number could have a different quantity?


7.64, Windows, Excel
 
Posts: 6 | Registered: September 24, 2008Report This Post
Platinum Member
posted Hide Post
Roxanna
I guess you would need to use 5 different amper variables. &var1, &var2, ....
This way you'd be prompted for 5 values of part #. You'll need to frame your WHERE clause accordingly.
Let me know if you need anything specifically.

Rock on!


Using WF 7.1.7/Dev Studio
 
Posts: 189 | Location: Boston, MA | Registered: July 12, 2005Report This Post
Virtuoso
posted Hide Post
You probably want to create a launch page with five different part numbers (&PART1 thru &PART5)and 5 different quantities (QTY1 thru &QTY5.) That will be the easiest way for you to assure that the selected quantites are associated with the proper part numbers. Then calculate and test each variable separately.

Multiselects within a combo box are a possibility, but the tricky part would be selecting/associating each with a different quantity. You could probably write some javascript to do it, but based on your skill level, I think this would be the easiest way to go.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Member
posted Hide Post
Sorry, but I guess I am still doing something wrong. WebFocus is very new to me, and the language is much different to what I am accustomed to. We are in process of moving off our current mainframe system, which I have been using for over 20 years.

Creating basic reports with WebFocus, is pretty easy, but I am having a problem with some of these more complex ones. I have tried using the help menus, which has helped some.

I understand how to prompt for the different part numbers multiple times. Where I am having a problem is with the quantity that will be different for each part that I am prompting for.

In my current system, I prompt for a part number and a qty, then dump it ito a subfile, then prompt for the next part, and qty and add to same subfile, and continue prompting for parts and qty until I am done. Then I access the subfile, and sum up all the quantities for each component that is similiar, and provide a total quantity of each component parts needed to start several jobs.

Am I creating this report all wrong?

In my current program, I understand Defines, and prompts very well. But I am very confused in WebFocus where to put the prompts...in the define, compute, or/and where clause. I have put it in a compute and where clause, which gives me correct data for several prompted parts, but only one quantity. I can't seem to figure out how to tell it to prompt for different quantities, and put the output into one column.

I also have been trying to use the Developer studio report painter to help me, but the help menus seem to be all based on the text code, so I have been going back in forth between the two, and they might be why I am getting more confused.

Hopefully this makes since, and any help would be greatly appreciated. This is what I have so far:

TABLE FILE BOMPRDST
PRINT
COMPUTE QTY_NEEDED/D12.4 = &PCA_QTY1 * QUANTITY_REQUIRED;
AS 'Qty Needed'
BY PART_NUMBER
BY COMPONENT_PART_NUMBER
BY QUANTITY_REQUIRED AS 'Qty Per'
WHERE PART_NUMBER EQ '&PART_NUMBER1' OR
PART_NUMBER EQ '&PART_NUMBER2' OR
PART_NUMBER EQ '&PART_NUMBER3' OR
PART_NUMBER EQ '&PART_NUMBER4' OR
PART_NUMBER EQ '&PART_NUMBER5';
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL2K
END


7.64, Windows, Excel
 
Posts: 6 | Registered: September 24, 2008Report This Post
Platinum Member
posted Hide Post
Roxanna
I understand that you are a li'l confused. Trust me - these things will gradually start making much more sense to you once you have developed a few reports.
To clarify your doubt, you could create 5 variables for Part nos. and corresponding 5 variables for their respective quantities.
You WHERE clause looks good. Now you'll have to modify your COMPUTE as follows:

COMPUTE QTY_NEEDED/D12.4 = IF PART_NUMBER EQ '&PART_NUMBER1' THEN (&PCA_QTY1 * QUANTITY_REQUIRED) ELSE IF PART_NUMBER EQ '&PART_NUMBER2' THEN (&PCA_QTY2 * QUANTITY_REQUIRED)......;

This way you'd get the QTY_NEEDED for all the different qtys. entered by the user. Also, you can have all the 10 prompts (5 parts and 5 qtys) at once, and the user then executes the report.

FYI instead of using IF in compute above, you could also use DECODE:
DECODE fieldname(code1 result1 code2 result2...[ELSE default ]);

However, IF in this case would work just fine and easy for you to relate to.

Hope you find this helpful.
Do let us know if you need further help.

Rock On!
Syed


Using WF 7.1.7/Dev Studio
 
Posts: 189 | Location: Boston, MA | Registered: July 12, 2005Report This Post
Expert
posted Hide Post
Roxanna,

Thanks for the background information. That was very helpful.

With that said, it is not always wise to try to reproduce a mainframe function exactly the same way in WebFOCUS. For one thing, it is a non-persistent environment and the language is non-procedural.

The best place to do prompting is in an HTML page. But first you have to have specified the variables in your program which you kind of have done. Darin, in his post, as well as Syed have recommended this. For this you need to use the HTML Layout Painter.

Open the HTML Layout Painter, select new, and put a button on it when it opens. Right-click the button, choose Reference an External Procedure, pick your program, and with a few more clicks, there will be controls on the page that match your variables. Rather than go into great detail on this process, I am going to refer you to manual "Developing Reporting Applications with Graphical Tools", the chapter on the HTML Layout Painter.

You can find this document by looking at the doc link in the upper right-hand corner of this page.

And a final question: is there a reason you have to do 5 parts at a time? Can the requestor just ask for one at a time and get a report for that one? That would make your life a lot simpler because once we get the 5 parts and matching quantities into your program, you may have to use some more sophiticated techniques to get them matched up.

I hope this helps and continue to ask questions as you move through this process. As we understand your problem better, we'll be able to give you more precise direction.


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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     How do I create a Define with a amper variable?

Copyright © 1996-2020 Information Builders