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

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Date
 Login/Join
 
Member
posted
-SET &CurrentDate = &DATE;
-? &CurrentDate

Yields:

CURRENTLY DEFINED & VARIABLES STARTING WITH 'CurrentDate':
&CurrentDate = 11/27/13

I would like it to be

CURRENTLY DEFINED & VARIABLES STARTING WITH 'CurrentDate':
&CurrentDate = 2013-11-27

The DATEfmt below is invalid.
-SET &CurrentDate = &DATEYY-M-D;

I can do it with a long EDIT and concatenation but I assumed their was some easy way?

This message has been edited. Last edited by: <Kathryn Henning>,


7.7.03, Windows
HTML, Excel, PDF,
 
Posts: 13 | Registered: October 07, 2013Report This Post
Expert
posted Hide Post
Try this


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Member
posted Hide Post
-SET &CurrentDate = DATETRAN(&YYMD, '(YYMD)', '(-)','EN', 50, 'A50');
-? &YYMD
-? &CurrentDate

Yeilds:

CURRENTLY DEFINED & VARIABLES STARTING WITH 'YYMD':
&YYMD = 20131127
CURRENTLY DEFINED & VARIABLES STARTING WITH 'CurrentDate':
&CurrentDate = i018-02-25

I obviously do not understand this sorry.


7.7.03, Windows
HTML, Excel, PDF,
 
Posts: 13 | Registered: October 07, 2013Report This Post
Expert
posted Hide Post
There is that book "1001 Ways to work with Dates", but alas i don't have one.
i think DATETRAN might be one of those functions that is tough to make work on &vars, not sure.
so, as you say, alot of use of EDIT,
or... cheat.
gets the job done, not quite as elegantly as you might like..
DEFINE FILE ibisamp/CAR
RUN_DATE/YYMD WITH COUNTRY =&YYMD.EVAL ;
DATE2/A10=DATETRAN(RUN_DATE, '(YYMD)', '(-)', 'EN', 10, DATE2)
END
TABLE FILE ibisamp/CAR
PRINT DATE2
IF RECORDLIMIT IS 1
ON TABLE SAVE
END
-RUN
-READ SAVE &newdate.A10
-TYPE &newdate




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
Guru
posted Hide Post
Tres simple!
-* File test2.fex
-SET &CURRENTDATE1 = &YYMD;
-? &CURRENTDATE1
-SET &CURRENTDATE2 = EDIT('&CURRENTDATE1.EVAL','9999-99-99');
-? &CURRENTDATE2
-EXIT
Happy Thanksgiving


jimster06
DevStu WF 7.6.11
W7
HTML, PDF, EXL2K
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
Virtuoso
posted Hide Post
Plus simple! but it's all the same really Big Grin

-SET &CurrentDate=EDIT(&YYMD,'9999-99-99');
-TYPE &CurrentDate



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Member
posted Hide Post
Thanks all. I did give up on the DATETRAN and just went back to the EDIT.

-SET &CurrentDashedDate = EDIT(&YYMD, '9999-99-99');

Thanks for the help.


7.7.03, Windows
HTML, Excel, PDF,
 
Posts: 13 | Registered: October 07, 2013Report This Post
Expert
posted Hide Post
Steven,
Would have worked fine if you add quotes around the 1st &YYMD; the EDIT is easier:

-SET &CurrentDate = DATETRAN('&YYMD', '(YYMD)', '(-)','EN', 50, 'A50');
-? &YYMD
-? &CurrentDate[/quote]


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders