Focal Point
Passing the System Date as a Parameter in Report Caster
January 30, 2006, 10:15 AM
JaywillPassing the System Date as a Parameter in Report Caster
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
January 30, 2006, 11:02 AM
susannahJaywill, 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...
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 |
January 30, 2006, 11:26 AM
Tony ATo 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 | |
January 30, 2006, 11:31 AM
JaywillThanks 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
January 30, 2006, 12:04 PM
susannahso 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 |
January 30, 2006, 12:20 PM
JaywillThanks a bunch to both of you, the .EVAL worked like a charm!!
WF 8.0.08 ... Windows Server 2008
March 10, 2006, 02:52 PM
BethanyI'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
March 10, 2006, 03:24 PM
Francis MarianiI 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
March 10, 2006, 03:33 PM
susannahhmmm. 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 |