Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Prompting for parameters
Go
New
Search
Notify
Tools
Reply
  
Prompting for parameters
 Login/Join
 
<rstull>
posted
I am in the process of trying to develop a report for our customers that would prompt them for an item code, and then produce a report displaying all orders that have that item on it for a predetermined amount of time. I have the framework of the report done, and it works. The problem I�m running into is when I try to include (-Include) an additional file. This file, a customer definition file, is set up so that when a customer logs in, he or she can see only information for their particular account. We�ve used this file in other reports that don�t prompt the user for parameters. However, in the report I am working on now, the user is prompted for parameters that should be supplied by the customer definition file. How can I set it up so that the user is prompted only for the item code? Here is what I have been working on.

-SET &ECHO=ALL;
SET LINES=999999
-INCLUDE CUSTDEF1
-RUN

TABLE FILE SALES

PRINT QTYORD BY PRODNO BY PRODNAME BY SHIPDT BY CUSTNO

ON TABLE HOLD AS HOLD1 FORMAT ALPHA

WHERE ADFLAG EQ 'A'
WHERE SHIPDT GE 20050101

-IF &CUSTPARM.EXIST GOTO IFTEST ELSE GOTO BYTEST;
-IFTEST
WHERE ( CUSTNAME EQ
'&CUSTPARM.CUSTPARM.'
);
-BYTEST
END

TABLE FILE HOLD1

PRINT
PRODNO NOPRINT
PRODNAME AS 'Product'
QTYORD AS 'Quantity Ordered'
SHIPDT AS 'Ship Date'

BY CUSTNO NOPRINT

WHERE ( PRODNO EQ '&PRODNO.Product Code.'
);

END
 
Reply With QuoteReport This Post
<NorthNone>
posted
I've done a lot with variables set in other fexes, but never with a period in the variable, so I'll stay with general comments:
1. What happens if you take the quotes off?
WHERE ( CUSTNAME EQ
&CUSTPARM.CUSTPARM.
);
2. Is there supposed to be a period at the end of
&CUSTPARM.CUSTPARM. ???
3. Can you print the value of the variable set in the other fex?
-TYPE Equals: &CUSTPARM.CUSTPARM
4. Finally, if you store the value of the variable set in the other fex to a new variable, can you print it to screen?
&NEWVAR = &CUSTPARM
-TYPE Equals: &NEWVAR
I wish I had something more specific to offer.
HTH
JSouth
 
Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Any parameter that is being explicitly set will not be prompted for. So, I would recommend that you issue a:
-SET &CUSTPARM='anything';
before the -INCLUDE.

I am assuming that &CUSTPARM is being set in the -INCLUDE'd fex.

Let me know if this works for you!
 
Posts: 1100 | Location: Toronto, Ontario | Registered: May 26, 2004Reply With QuoteReport This Post
<rstull>
posted
Thank you both for your suggestions. I'm still somewhat of a novice, so could you tell me what the purpose of issuing the -SET &CUSTPARM is? The &CUSTPARM is set by the -INCLUDEd fex.

Thanks,

Rachel
 
Reply With QuoteReport This Post
Virtuoso
posted Hide Post
When WebFOCUS prompts you for a parameter list, it will only prompt you for parameters that haven't been explicitly set. This means that only parms that do not have a -SET will be prompted for. Unfortunately, your version of WF is not parsing the -INCLUDEd focexec. This means that it does not read the -SET in the include, and therefore thinks that it is an unresolved parm.

That might not be that clear!!! Maybe someone else can add to this?
 
Posts: 1100 | Location: Toronto, Ontario | Registered: May 26, 2004Reply With QuoteReport This Post
<NorthNone>
posted
I'm curious as to whether you are able to print the value of the variable set in the other fex when running the original fex:
-TYPE ------------------------------------
-TYPE TYPING OUT THE VALUE OF PARAMETERS
-TYPE FIRST PARAMETER: &CUSTPARM.CUSTPARM
-TYPE SECOND PARAMETER: &CUSTPARM
-TYPE ------------------------------------
Should give you this when you run your fex:
------------------------------------
TYPING OUT THE VALUE OF PARAMETERS
FIRST PARAMETER: (ValueOfParameterAppearsHere)
SECOND PARAMETER: (ValueOfParameterAppearsHere)
------------------------------------
If you do not get values, then you've proved that the -INCLUDE'd fex did not set the values, else you proved that it DID set the values.
If it DID set the values, look to the syntax of your code for the problem.
What version of WebFOCUS are you on?
HTH
JSouth
 
Reply With QuoteReport This Post
<rstull>
posted
Thanks again! I have some time set aside today to work on this, so I'll let you know how it goes. We are running version 5.2.3.

Rachel
 
Reply With QuoteReport This Post
<NorthNone>
posted
Rachel, how are things going?
 
Reply With QuoteReport This Post
<rstull>
posted
Thanks for checking back with me! I am still having issues. I tried using the -SET &CUSTPAR command but that didn't seem to work. I haven't tried your suggestions yet, largely because I am not sure where in the code to put it. I tried to research it in the documentation I have, but I haven't really found any answers yet.
 
Reply With QuoteReport This Post
<NorthNone>
posted
Well, I would put the code to type out the parameters I was looking for just after the -INCLUDE to the fex where you expect those parameters to be set.
 
Reply With QuoteReport This Post
<rstull>
posted
I ended up going another direction with this report. Thanks again for your help!
 
Reply With QuoteReport This Post
<NorthNone>
posted
...and thank you for letting all of us know that you resolved your problem successfully, even if it wasn't the way you'd planned on.
 
Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Prompting for parameters

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.