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.

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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Date Format
 Login/Join
 
Platinum Member
posted
Hi,

Can a date formatted for example (2007070400) be converted to 2007/07/04? The two zeros at the end need to be parsed out. I can't find examples on this. Thanks for any help.

Joe


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
Virtuoso
posted Hide Post
Joe

yes it can....

There are many ways depending on the original format.

If it is a string (A10)

NEWYMD/A8YYMD=EDIT(ORIGINAL,'99999999');

But it also depends on the way you want to use the result. If you want to calculated with it, you should convert it to a smartdate.

There is a very good money worth book (U$ 25) that explanes all the formulas.




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, 2006Report This Post
Virtuoso
posted Hide Post
I believe the "Using Functions" book is also available via download for registered users, but I have a printed copy (to read in my spare time. Also serves as a nice desk decoration. I keep it in a very "reachable" spot.)


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, 2007Report This Post
Virtuoso
posted Hide Post
Darin

the book I referred to is the "Almost 1001 ways to work with dates" and is not in digital format available.




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, 2006Report This Post
Platinum Member
posted Hide Post
Thanks,

Actually, the date field in question - event_partkey is originally formatted as I11. I tried NEWYMD/I8YYMD = EDIT(EVENT_PARTKEY,'99999999'); and received a format error. Should I redefine the metadata as A10 and not as an integer.

Thanks,
Joe


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
Virtuoso
posted Hide Post
Joe

do it in steps

NEWADATE/A11=EDIT(ORIGINAL); is converting from Integer to alpha.

NEWYMD/A10=EDIT(NEWADATE,'99/99/9999$$'); is masking the alpha string to the format you want, but keep in mind this is only a date looking string and not a real smart date.




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, 2006Report This Post
Master
posted Hide Post
If the orginal date is I11, to convert to smart date use the following in a DEFINE:

FMTDT/YYMD=DATECVT(ORIG_DT/1000,'I8YYMD','YYMD');

For example:
DEFINE FILE MACGYVER
ORIG_DT/I11=20071231000;
FMTDT/YYMD=DATECVT(ORIG_DT/1000,'I8YYMD','YYMD');
END
TABLE FILE MACGYVER
PRINT ORIG_DT FMTDT
WHERE COUNTER EQ 1
END


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Guru
posted Hide Post
This seems to work as well:

 DEFINE FILE CAR
IDATE/I11 = 2007070400;
IDATE1/I8YYMD = IDATE/100;
IDATE_YYMD/YYMD = IDATE1;
END
TABLE FILE CAR 
PRINT IDATE IDATE1 IDATE_YYMD
BY COUNTRY
END 


ttfn, kp


Access to most releases from R52x, on multiple platforms.
 
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003Report This Post
Platinum Member
posted Hide Post
Thanks for all your help. I finally got it to work. I did the following:

NEWADATE/A11=EDIT(EVENT_PARTKEY,'$99999999$$');
NEWYMD/A10=EDIT(NEWADATE,'9999/99/99');

Worked great!


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
Virtuoso
posted Hide Post
Joe

why do you have to mask the first character?
is there a space in the database field?
is it always there?

what I would do in this case to be sure it works always is first convert the A11-string to an integer.

NEWINT/I10=EDIT(NEWADATE);

then use the integer for the next step as suggested by Piipster.




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, 2006Report This Post
Platinum Member
posted Hide Post
That's what baffled me too. I did not see a space in the first character until I ran test data. I'll try your suggestion and let you know how it works.

Joe


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders