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     Date Input Parameter Issue

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Date Input Parameter Issue
 Login/Join
 
Member
posted
In my report there is an input parameter for Date, for which i need to set a default value from the column of a table, if nothing has been entered by the user.
Following is my code:

JOIN
TABLE1.COL_01 IN TABLE1
TO UNIQUE TABLE2.COL_05
IN TABLE2 AS J0
END

DEFINE FILE TABLE1
CURRENTDATE/A8YYMD = COL_04;
CURRENTDATESTR/A8 = CURRENTDATE;
END

TABLE FILE TABLE1
PRINT
COL_01 AS 'Column 1'
COL_02 AS 'Column 2'
CURRENTDATE AS 'Current Business date'
CURRENTDATESTR/A8 AS 'Current Date String'

-PROMPT &ENTER_DATE.Enter The date.MDYY;

- SET &DATEFINAL = CURRENTDATESTR;
- SET &ENTER_DATE = IF &ENTER_DATE NE '' THEN SUBSTR(10, &ENTER_DATE, 7, 10, 10, 'A8') || SUBSTR(10, &ENTER_DATE, 1, 2, 2, 'A8') || SUBSTR(10, &ENTER_DATE, 4, 5, 5, 'A8') ELSE &DATEFINAL ;

WHERE ( COL_03 EQ '&ENTER_DATE');
END

If I hardcode the value in DATEFINAL by replacing the line
- SET &DATEFINAL = CURRENTDATESTR;
with:
- SET &DATEFINAL = '20070327';
It works fine
Infact teh value in CURRENTDATESTR=20070327, but it does not work and gives me an error:
0 ERROR AT OR NEAR LINE 58 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC177) INVALID DATE CONSTANT: )
(FOC009) INCOMPLETE REQUEST STATEMENT
BYPASSING TO END OF COMMAND

Please suggest what can be other alternative, as i need to set the default value from the column of a table.
 
Posts: 3 | Registered: July 03, 2007Report This Post
Expert
posted Hide Post
Nidhi,

You are trying to combine dialogue manager with a table request which, as has been mentioned many times before on this forum, you cannot do.

Again, this would be covered in training courses, so press your management to provide some for you, and then you might have a chance of being productive without resorting to asking for guidance on this sort of problem.

Also try searching the forum for similar posts or asking amongst your colleagues who, no doubt, have raised this question before.

Above all demand some training from your management.

T
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Guru
posted Hide Post
Nidhi, you can't pass a field from your TABLE Request into Dialogue Manager variable without having to write it to a file and then having Dialogue Manager use -READ to retrieve it.

So, in my opinion, what you need to do first is to follow Tony's suggestion on getting training and/or read all the manuals and tutorials and then do something like this:

-* This is untested code...

-PROMPT &ENTER_DATE.Enter The date.MDYY;
-IF &ENTER_DATE EQ '' THEN GOTO NEXT01;

-SET &DATEFINAL = SUBSTR(10, &ENTER_DATE, 7, 10, 10, 'A8') || SUBSTR(10, &ENTER_DATE, 1, 2, 2, 'A8') || SUBSTR(10, &ENTER_DATE, 4, 5, 5, 'A8');

-NEXT01

JOIN
TABLE1.COL_01 IN TABLE1
TO UNIQUE TABLE2.COL_05
IN TABLE2 AS J0
END

DEFINE FILE TABLE1
CURRENTDATE/A8YYMD = COL_04;
CURRENTDATESTR/A8 = CURRENTDATE;
END

TABLE FILE TABLE1
PRINT
COL_01 AS 'Column 1'
COL_02 AS 'Column 2'
CURRENTDATE AS 'Current Business date'
CURRENTDATESTR AS 'Current Date String'

-IF &ENTER_DATE EQ '' THEN GOTO NEXT02;
WHERE ( COL_03 EQ '&DATEFINAL');
-GOTO NEXT03

-NEXT02
WHERE ( COL_03 EQ CURRENTDATESTR);

-NEXT03
END
-RUN


There's probably 5 million things wrong with that code I wrote above which is just a cut-and-paste of your original code re-organized to use a different WHERE clause when your &ENTER_DATE is not supplied.


WF 8.1.05 Windows
 
Posts: 333 | Location: Orlando, FL | Registered: October 17, 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     Date Input Parameter Issue

Copyright © 1996-2020 Information Builders