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.
take the system date and time from your operating system. in win2k, i use the two &vars &YYMD and &TOD for today's date and time-of-day. e.g. -SET &HOUR = EDIT(&TOD,'99'); -SET &M = IF &TOD GT '12.00.00' THEN 'pm' ELSE 'am'; -SET &FLAG = IF &TOD GT '13.00.00' THEN 1 ELSE 0 ; -SET &HOUR = IF &FLAG IS 1 THEN &HOUR - 12 ELSE &HOUR ; -SET &MINUTES = EDIT(&TOD,'$$$99'); -SET &SECONDS = EDIT(&TOD,'$$$$$$99'); -SET &TIME = &HOUR | ':' | &MINUTES | &M;
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
eli, Do you mean you just want it in your heading for information ? if so in text editor you can put the following code in your heading lines. "&DATEtrMDYY " "&TOD"
I wasn't sure exactly what you were asking for. If neither answer is what you were looking for maybe you could give us an example....
Posts: 132 | Location: Kansas | Registered: November 12, 2003
Since this post was a couple of releases ago....is there a different way to Timestamp the time in non-military time as Susannah has done here...that does not require so many steps?
In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005
As far as effficiency goes... remember that a DEFINE is evaluated for every row of data that passes your WHERE statemements. The -SET is evaluated only once and then can be used in many places.
ttfn, kp
Access to most releases from R52x, on multiple platforms.
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003
When you say non-military, do you mean taking the time zone of the machine? If so there is an article by John Gray that uses reg.exe in a windows based system here in the Focus on Developers pages. This article also references the Zulu Time article by Susannah and both make excellent reading.
I have taken John's suggestion and produced a fex that you can include to obtain an offset -
-* system call to write the registry value to a file
! REG QUERY HKLM\SYSTEM\CURRENTCONTROLSET\CONTROL\TIMEZONEINFORMATION /V ACTIVETIMEBIAS > TZ.TXT
-*(above must be on one line)
-* filedef the file generated so that it can be read using a -READ
APP FI TZ DISK TZ.MAS
-RUN
-WRITE TZ
-WRITE TZ FILE=TZ,SUFFIX=FIX
-WRITE TZ SEGNAME=SEG1
-WRITE TZ FIELD=DATA_KEY,,A80,A80,$
-WRITE TZ DEFINE HEX/A10 = RJUST(10,GETTOK(DATA_KEY, 128, -1, 'x', 10, 'A10'),'A10');
-WRITE TZ DEFINE HEX1A/A3 = EDIT(HEX,'$$$$$$$9$$');
-WRITE TZ DEFINE HEX2A/A3 = EDIT(HEX,'$$$$$$$$9$');
-WRITE TZ DEFINE HEX3A/A3 = EDIT(HEX,'$$$$$$$$$9');
-WRITE TZ DEFINE HEX1/I3 = IF HEX1A EQ ' ' THEN 0 ELSE IF HEX1A FROM '0' TO '9' THEN BYTVAL(HEX1A, 'I3') - 48 ELSE BYTVAL(HEX1A, 'I3') - 87 ;
-WRITE TZ DEFINE HEX2/I3 = IF HEX2A EQ ' ' THEN 0 ELSE IF HEX2A FROM '0' TO '9' THEN BYTVAL(HEX2A, 'I3') - 48 ELSE BYTVAL(HEX2A, 'I3') - 87 ;
-WRITE TZ DEFINE HEX3/I3 = IF HEX3A EQ ' ' THEN 0 ELSE IF HEX3A FROM '0' TO '9' THEN BYTVAL(HEX3A, 'I3') - 48 ELSE BYTVAL(HEX3A, 'I3') - 87 ;
-RUN
FILEDEF TZ DISK ./TZ.TXT (LRECL 80 RECFM V
-RUN
TABLE FILE TZ
PRINT COMPUTE MyOffset/D5 = ( -4096 * (HEX CONTAINS 'fffff')) + ((HEX1 * 256) + (HEX2 * 16) + HEX3);
WHERE DATA_KEY CONTAINS 'ACTIVETIMEBIAS'
ON TABLE SAVE AS HEXVALUE
END
-RUN
-* read the saved data that contains the required value
-READ HEXVALUE &Offset.A5.
-RUN
and used it in another fex using Susannah's suggestion within a reuseable function -
Based on my reading of the request, it would seem Prairie wants a value like:
YYYY/MM/DD HH:MM:SSAP
where YYYY is the year; MM is the month; DD is the day; HH is the hour; MM is the minute; SS is the second; and AP is 'AM' or 'PM'.
Assuming that is what's wanted, you can use a DEFINE with the appropriate format. If you don't reference any database fields, it is only evaluated ONCE. You can see this with a '? DEFINE', which shows that the define is NOT associated with any segment (it's global).
If you want it via Dialogue Manager, you can also get it. The first thing you need to understand, is that EVERY field stored as a Dialogue Manager value, is stored as a character string. That's why you have to work to get decimals from a calculation, as we don't know HOW MANY decimal places to keep.
This is actually a subroutine call as an argument to another subroutine call. The HGETC retrieved the current date-time, as a DATE-TIME formatted field. We provide that as the FIRST argument to the HCNVRT routine, which converts a date-time field to an alpha (required by D.M. remember?).
The current time is retrieved to milliseconds, then converted to a display format with the time indicated by an AM or PM.
Hope that's what you were looking for.
Posts: 25 | Location: 2 Penn Plaza 28 fl | Registered: March 27, 2003