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.
I've used the Zulu Time article to convert the Epoch time to a "normal" date format. Now I need to convert that resulting A20 field to a date field that I can compare against "today" in my criteria.
STDATE_A1/A20= HCNVRT(STDATE2,'(HYYMDIA)',20,'A20');
STDATE_A/A20= GETTOK(SQUEEZ(20,STDATE_A1,'A20'),20,1,' ',20,'A20');
and
WHERE STDATE_A EQ '&DATEYYMD'
&YYMD will get you the date when the session started (depends on how long your request takes to run).
I think it may be better to get the current date into a smart date (Format YYMD) and test against that, you can use HDATE to covert your DateTime to a Date.
I know how to get today's date. My concern is whether the "CYCLSTART/A20 = HCNVRT(FOCUSDATEST,'(HYYMDIA)',20,'A20');" define results in a value that can be compared to today's date.
If you are new to focus I would suggest you buy a very good book on dates. "Almost 1001 Ways to work with DATES in WebFOCUS" it's worth all the money. And there are some great PDF files available on the Information Builders website.
An other suggestion is to upgrade your signature with information about the systems you use (version etc)
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006
RE: the original error ... DATECVT can take "smart dates" (which internally are integers with number of days since 1900), old alpha dates or old interger dates. CYCLSTART is NOT a new date, it is an alpha, so datecvt knows that and tells you. This should work: DATECVT ( CYCLSTART , 'A8MDYY' , 'I8MDYY' ) ;
Brian Suter VP WebFOCUS Product Development
Posts: 200 | Location: NYC | Registered: January 02, 2007
The one issue with Daniel's solution is that you end up doing a selection on a DEFINED field, so there is a significant drop in efficiency, as those criteria cannot be passed to the DBMS. It's always better to make your variable format match the format of your real database field instead of the other way around.
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, 2007
PHawk, if infact 2DATE is already a smart date, then MONTH/M = 2DATE; YEAR/YY = 2DATE; is all in the world you need. Smart dates are so so so easy to format.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
On our old server this would tell us how many months are between the two dates, but on the new server I got the same error about an invalid arguement in #1 of DATECVT.
I fixed this report by doing some different conversions but the root of the problems is the function DATECVT.
Syntax: How to Convert the Format of a Date DATECVT(date, in_format, out_format)
where:
date Is the date to be converted. ... When the conversion is performed, a legacy date obeys any DEFCENT and YRTHRESH parameter settings supplied for that field.
- - - - But if you declare it as /A4YM, you can directly cast it to a year-month smart date without resorting to DATECVT:
DEFINE FILE CAR
SERYMA/A4YM WITH COUNTRY=EDIT('&YMD','9999');
SERYM/MTYY DFC 19 YRT 50 =SERYMA;
END
TABLE FILE CAR
PRINT SERYMA SERYM
IF RECORDLIMIT EQ 1
END
This message has been edited. Last edited by: j.gross,
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005