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     Passing the System Date as a Parameter in Report Caster

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Passing the System Date as a Parameter in Report Caster
 Login/Join
 
Member
posted
Hello everyone,
I have a report which needs a date parameter as follows:

WHERE STC_STATUS_DATE EQ HDTTM('&Status_Date', 8, 'HYYMDs')

STC_STATUS_DATE is a datetime in SQLServer.

The report works fine if I run it and provide a date at the prompt like so: 20060130.

I want to schedule this report to run in Report Caster and have the System Date passed as the date parameter. I have tried to use the &YYMD variable but it was unsuccessful and gave the following error message:

INVALID TYPE OF ARGUMENT #1 FOR USER FUNCTION HDTTM

Does anyone know the correct way to pass the system date as a parameter in Report Caster?
Any help or suggestions would be greatly appreciated.

Regards,

Jason


WF 8.0.08 ... Windows Server 2008
 
Posts: 21 | Registered: January 27, 2006Report This Post
Expert
posted Hide Post
Jaywill, it appears that the first argument to the HDTTM function must be a smart date, rather than an I8.
If you convert the system date to a smart date, then put the smart date into the HDTTM function, it would work;
here's a carfile example, working in windows, now granted there's a more elegant way to get from i8 to yymd...Wink in DM, use DATECVT function
DEFINE FILE CAR
TODAY/I8YYMD WITH CAR = &YYMD ;
STODAY/YYMD = TODAY;
1DATE/HYYMDs WITH CAR=HDTTM( STODAY , 8, 'HYYMDs')
END
TABLE FILE CAR PRINT TODAY 1DATE CAR
END




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
To work your requirement into Susannah's example, try -
-SET &Status_Date = AYMD(&YYMD,0,'I8YYMD');
-* or
-SET &Status_Date = &YYMD;

DEFINE FILE CAR
TODAY/I8YYMD WITH CAR = &YYMD ;
STODAY/YYMD = TODAY;
1DATE/HYYMDs WITH CAR = HDTTM( STODAY , 8, 'HYYMDs');
END
TABLE FILE CAR PRINT TODAY 1DATE CAR
WHERE 1DATE EQ HDTTM('&Status_Date.EVAL' , 8, 'HYYMDs');
END

Either &Status_Date is acceptable to the HDTTM function.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Member
posted Hide Post
Thanks for the suggestion Susannah!
For this report, I'm trying to keep it generic so that it may be run on demand by a user who can supply any date they wish, or it can be run on a schedule in Report Caster with the System date. I'm trying to set this up from within the Report Caster Gui for Schedule Management, so all I can supply for &Status_Date is the NAME/VALUE pairing on the Parameters tab.

Other suggestions??


WF 8.0.08 ... Windows Server 2008
 
Posts: 21 | Registered: January 27, 2006Report This Post
Expert
posted Hide Post
so you just have to edit the date you pass is a smartdate, rather than an i8;
T says to try a .EVAL after your statusdate in your function as it is already. Give that a try... That .EVAL works magic...but do remember to tell us your version/system in your signature (edit your profile..muchas gracias)




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Member
posted Hide Post
Thanks a bunch to both of you, the .EVAL worked like a charm!!


WF 8.0.08 ... Windows Server 2008
 
Posts: 21 | Registered: January 27, 2006Report This Post
Platinum Member
posted Hide Post
I'm trying to set up the same thing as Jaywill-report that can be run by report caster passing the system date and also be a user who can supply any date. I've added the .EVAL to my fex procedure. What do I need set the report caster variable to so I can pass &YYMD?

Thanks


Server Environment: Win2K3 Server WebFOCUS 7.13 Apache Tomcat standalone application server
 
Posts: 188 | Registered: April 14, 2005Report This Post
Expert
posted Hide Post
I would set up a default date in the fex; pass the date as &REP_DATE from the user request and NOT pass the system date from Report Caster:

-DEFAULT &REP_DATE = '&YYMD.EVAL';

Use &REP_DATE if all further calculations.


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
hmmm. i don't think that actually works...
when you try it, what do you get?
i get that &REP_DATE is set to an actual character string '&YYMD.EVAL'...
??




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report 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     Passing the System Date as a Parameter in Report Caster

Copyright © 1996-2020 Information Builders