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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Hot to convert a packed date field to display in MDYY format

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Hot to convert a packed date field to display in MDYY format
 Login/Join
 
Platinum Member
posted
Here is the problem, I am working with SMF records which are VSAM records. They come with FOCUS. The field in the SMFFIX MASTER
has these attibutes FIELD=SMFOFDTE,,P9 ,P4 ,$ DATE, PACKED (0CYYDDDF)

The following DEFINEs:
PDATE/P9=SMFOFDTE;
IDATE/I9=PDATE;
ODATE/I8YYMD=DTYMD(IDATE, ODATE);
SMFDATE/MDYY=ODATE;

Results:
SMFOFMSO USER SMFOFDTE PDATE IDATE ODATE SMFDATE
EDA77TW1 actrrc1 113245 113245 113245 2210/01/20 01/20/2210
113245 113245 113245 2210/01/20 01/20/2210
113247 113247 113247 2210/01/22 01/22/2210
113247 113247 113247 2210/01/22 01/22/2210

I have not worked with packed date fields in a very long time. What am I missing?

Thanks in advance - Rhonda

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


WebFOCUS & ReportCaster 8.1.05, 7.7.03 - AIX/LINUX, FOCUS 7.6.13 MVS, Output PDF, XLS-XLSX, DOCX and HTML
 
Posts: 146 | Location: Atlanta, GA | Registered: May 31, 2007Report This Post
Expert
posted Hide Post
Hi Rhonda,
If I recall, packed date columns correleate to:
 
Byte 1:    Converts to a century 0=19, 1=20
Bytes 2-3: YY
Bytes 4-6: Day of the Year(Julian)


May need to use JULDAT/GREGDT functions...
hth
Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
Your code looks OK, though you could probably skip a couple of steps, but is the clue in the comment at the end of the metadata line, "0CYYDDDF"? Is it possible that the field does not contain a conventional date?

I don't know what the "F" stands for, but looking at "113245" - does the 11 mean 2011, is the 324 a component of a Julian date?

SMFOFMSO USER    SMFOFDTE PDATE  IDATE  ODATE      SMFDATE
-------- ------- -------- ------ ------ ---------- ----------
EDA77TW1 actrrc1 113245   113245 113245 2210/01/20 01/20/2210
                 113245   113245 113245 2210/01/20 01/20/2210
                 113247   113247 113247 2210/01/22 01/22/2210
                 113247   113247 113247 2210/01/22 01/22/2210 


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
Tom is almost right. From the IBM info center:
Definition of the format used to represent dates (OCYYDDD+)
The numbers are written in +ve byte packed decimal.
'0C' is the number of centuries since 1900. All dates in the 21st century have '01'.
'YY' is the year.
'DDD' is the day of the year. The first day of the year is '1' and the last day of the year '366'.
'+' is hard coded as 0xC.
So:
10 January 2007  = 0107010C
 1 January 2001  = 0101001C
31 December 2012 = 0112366C


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Platinum Member
posted Hide Post
Thank you for all for your help! Here are the defines I created I may have taken more steps than necessary to get what I wanted but it was worth it. Thanks again!
*************************
PDATE/P6=SMFOFDTE;
IDATE/I6=PDATE;
ZDATE/A5=EDIT(IDATE,'$99999');
XDATE/I5=EDIT(ZDATE);
GREG_DATE/I8 = GREGDT(XDATE,'I8');
********************************
Rhonda


WebFOCUS & ReportCaster 8.1.05, 7.7.03 - AIX/LINUX, FOCUS 7.6.13 MVS, Output PDF, XLS-XLSX, DOCX and HTML
 
Posts: 146 | Location: Atlanta, GA | Registered: May 31, 2007Report 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] Hot to convert a packed date field to display in MDYY format

Copyright © 1996-2020 Information Builders