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
interger to date
 Login/Join
 
Silver Member
posted
how to convert a yymmdd integer field to a date field in yy/mm/dd format? Can we convert date parameters to an integer?


WebFocus 762 AS400 / DB2
 
Posts: 34 | Location: Winnipeg, MB | Registered: January 23, 2008Report This Post
Expert
posted Hide Post
Noel, is it a "smart date" or a Date-Time date?

for "smart" date, you can do the following (DT1 is your integer date):
TABLE FILE CAR
PRINT
CAR
COMPUTE DT1/I8 = 20080306;
COMPUTE DT2/I8YYMD = DT1;
COMPUTE DT3/YYMD = DT2;
END


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
For a date-time field (DT1 is your integer date):

TABLE FILE CAR
PRINT
CAR
COMPUTE DT1/I8 = 20080306;
COMPUTE DT2/A14 = EDIT(DT1) | '000000';
COMPUTE DT3/HYYMDS = HINPUT(14, DT2, 8, 'HYYMDS'); 
END


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
You can convert dates in smart date format to integers by reversing the process Francis posted, if that's what you want.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Virtuoso
posted Hide Post
Not forgetting DATECVT, for almost any type of conversion:
DEFINE FILE CAR
D1/I8=20080302;
D2/YYMD=DATECVT(D1, 'I8YYMD','YYMD');
D3/I8YYMD=DATECVT(D2, 'YYMD','I8YYMD');
END
TABLE FILE CAR
PRINT D1 D2 D3
BY COUNTRY
END


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
I have never had to use the DATECVT function for this type of conversion. Francis' code in his original post has always worked fine .


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

True for simple conversions, but where there needs to be a transformation, say from A8YYMD to DMYY, then DATECVT can cut out some steps.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
Exactly. I was referring to Francis' code which was the same as your example. If the conversions are more complex, DATECVT is shorter/easier.


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
Yes, I was being lazy copying Francis' code.... it's Friday.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
And I have never used the DATECVT function, so learning new stuff all the time.

Stay warm or cool as the case may be all. Have a great weekend.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Expert
posted Hide Post
i always created smart dates the same way frankie martini did here:

quote:
TABLE FILE CAR
PRINT
CAR
COMPUTE DT1/I8 = 20080306;
COMPUTE DT2/I8YYMD = DT1;
COMPUTE DT3/YYMD = DT2;
END

but just the other day on this hear point i learned that just

COMPUTE DT3/YYMD = 20080306 ;
works like a charm.
"You can't fool me. I listen to public radio!" - Squidward




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
Platinum Member
posted Hide Post
Leah, Suzanne:

Even the best pick up tips here Smiler


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0
 
Posts: 195 | Registered: October 27, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders