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     I'm still trying to understand dates.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
I'm still trying to understand dates.
 Login/Join
 
<MikeBres>
posted
Specifically I'm looking for a way to organize the data by week. In general I'm trying to get a handle on how to use dates.
I've read all the topics I can find on dates. Yet something still eludes me. For instance I tried this example from the forum:
00001 -SET &TODAY=&YYMD/100;
00002 -SET &WEEK = HPART(&YYMD, 'WEEK', 'I2');
00003 -SET &LAST_MONTH = AYM(&TODAY,-1,YYM);
00004 -SET &THIS_MONTH = AYM(&TODAY,0,YYM);
00005 -SET &SDATE = &LAST_MONTH||'01';
00006 -SET &FIRSTDAY = &THIS_MONTH||'01';
00007 -SET &EDATE = AYMD(&FIRSTDAY,-1,YYMD);
00008 -SET &DT1_YYMD = '&YYMD';
00009 -* DETERMINE BEGINNING OF WEEK FOR SELECTED DATE
00010 -SET &WTDF =
00011 - DATECVT(( DATEMOV((DATECVT(&DT1_YYMD,'I8YYMD','YYMD')),'BOW')),
00012 - 'YYMD','I8YYMD');
00013 -TYPE TODAY = &TODAY
00014 -*-TYPE WEEK=&WEEK
00015 -TYPE LAST_MONTH = &LAST_MONTH
00016 -TYPE THIS_MONTH = &THIS_MONTH
00017 -TYPE FIRSTDAY = &FIRSTDAY
00018 -TYPE START_RANGE = &SDATE
00019 -TYPE END_RANGE = &EDATE
00019 -TYPE END_RANGE = &EDATE
00020 -TYPE BEGIN_WEEK = &WTDF
00021 -EXIT

And I get zeros:
TODAY = 200412
LAST_MONTH = 0
THIS_MONTH = 0
FIRSTDAY = 001
START_RANGE = 001
END_RANGE = 0
BEGIN_WEEK = 0

I try using HPART like this:
-SET &WEEK = HPART(&YYMD, 'WEEK', 'I2');

and I get an error that says: IMPROPER USE OF 'GOTO'. Huh? What does this have to do with dates?

There is just someting I'm missing on using dates. Can anybody help me out?

Thanks
Mike
 
Report This Post
<Pietro De Santis>
posted
Dates in WebFOCUS aren't much fun! Check out this documentation:

http://techsupport.informationbuilders.com/tech/ibm/ibm_nf_nf751.html

The AYM function requires only the Year and Month portion of a date, that's why you were getting zero.

Here's the corrected code (I haven't got HPART to work in Dialog Manager yet).

-*-SET &ECHO=ALL;
-SET &TODAY_DT = &YYMD;
-SET &TODAY_YYM = EDIT(&TODAY_DT,'999999');

-*-SET WEEK = HPART(&YYMD, 'WEEK', 'I2');

-SET &LAST_MONTH = AYM(&TODAY_YYM,-1,YYM);
-SET &THIS_MONTH = AYM(&TODAY_YYM,0,YYM);

-SET &SDATE = &LAST_MONTH || '01';
-SET &FIRSTDAY = &THIS_MONTH || '01';

-SET &EDATE = AYMD(&FIRSTDAY,-1,YYMD);

-* DETERMINE BEGINNING OF WEEK FOR SELECTED DATE
-SET &WTDF =
- DATECVT(( DATEMOV((DATECVT(&TODAY_DT,'I8YYMD','YYMD')),'BOW')),
- 'YYMD','I8YYMD');

-TYPE TODAY_DT = &TODAY_DT
-*-TYPE WEEK=&WEEK
-TYPE LAST_MONTH = &LAST_MONTH;
-TYPE THIS_MONTH = &THIS_MONTH;
-TYPE FIRSTDAY = &FIRSTDAY;
-TYPE START_RANGE = &SDATE;
-TYPE END_RANGE = &EDATE;
-TYPE BEGIN_WEEK = &WTDF;
 
Report This Post
<Grzegorz>
posted
I strongly advice you to use the Time Dimension Technique . I am using it everywhere I am allowed to (or not), and it always works.

Regards
Grzegorz

This message has been edited. Last edited by: <Mabel>,
 
Report 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     I'm still trying to understand dates.

Copyright © 1996-2020 Information Builders