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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Current Date and Time

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Current Date and Time
 Login/Join
 
Gold member
posted
I'm trying to get the current date and time using the code below:
-SET &TODAY=EDIT(&YYMD, '99999999');
-SET &TIME=HHMMSS('A8');
DEFINE FILE CONTACT
TODAY/YYMD=&TODAY;
TIME1/A8=&TIME;
END
TABLE FILE CONTACT
PRINT
TODAY
TIME1
END

But I receive this error every time:
0 ERROR AT OR NEAR LINE 5 IN PROCEDURE mav_ext_manual_lca
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: 10.39.59
0 ERROR AT OR NEAR LINE 10 IN PROCEDURE mav_ext_manual_lca
(FOC003) THE FIELDNAME IS NOT RECOGNIZED: TIME1
BYPASSING TO END OF COMMAND
(FOC009) INCOMPLETE REQUEST STATEMENT

What am I doing wrong?

This message has been edited. Last edited by: Kerry,


WebFOCUS 768
OS/400
HTML, also quite a few active reports and excel.
 
Posts: 59 | Registered: June 18, 2009Report This Post
Expert
posted Hide Post
Alpha columns require quotes...

TIME1/A8='&TIME';


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
You may also have to add quotes for the yymd field ( TODAY/YYMD='&TODAY'; ).


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Expert
posted Hide Post
Hey Gamp,

DM treats the TODAY output the same; actually, the answer comes via multiple paths up the WebFOCUS mountain:

You can do this:
 
-SET &TODAY=EDIT(&YYMD, '99999999');
-SET &TIME= '''' || HHMMSS('A8') | '''';
DEFINE FILE WHATEVER
   TIME1/A8      = &TIME;


OR, my response above,

OR

  
DEFINE FILE WHATEVER
 CUR_DATE/A10  = '&DATEYYMD';
 TIME1/A8      = HHMMSS('A8');


Whatever floats your boat!!!


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
Yeah Tom, I know, there are many ways to do something right (or wrong of course).
As long as the bottom line is that the problem gets solved ....


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Guru
posted Hide Post
Do you really want to get the date and time separately? If not, you can use the HGETC function.


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
 
Posts: 454 | Location: Europe | Registered: February 05, 2007Report This Post
Gold member
posted Hide Post
HGETC worked great! Thanks!!


WebFOCUS 768
OS/400
HTML, also quite a few active reports and excel.
 
Posts: 59 | Registered: June 18, 2009Report 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     [SOLVED] Current Date and Time

Copyright © 1996-2020 Information Builders