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     Follow on to Chanllenge: Date Convert

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Follow on to Chanllenge: Date Convert
 Login/Join
 
Member
posted
I was looking to determine the beginning and end of last week and used your suggetions to get this far:

All of your suggestions have been helpful. I have gotten this far:


-SET &TODAY = &YYMD;
-SET &LASTDT = &TODAY - 7;
-SET &LASTSUND = DATEMOV(&LASTDT, BOW);
-SET &LASTSAT = &LASTSUND +6;

-TYPE &TODAY
-TYPE &LASTDT
-TYPE &LASTSUND
-TYPE &LASTSAT

The above determinEs the current data, subtracts 7 days to get to last week, goes to the Beginning of last Week, and then determines 6 days after the beginning of last Week.

Now, I am looking to compare the &LASTSUND in YYMD format to the PRODDATE IN MDYY FORMAT. How can I change the format of the &LASTSUND FORMAT FROM YYMD TO MDYY?


Into the Memory Hole!
 
Posts: 9 | Registered: March 16, 2007Report This Post
Expert
posted Hide Post
-SET &TESTDATE1 = &YYMD;
-SET &TESTDATE2 = CHGDAT('YYMD', 'MDYY', &TESTDATE1, 'A8');

-TYPE &TESTDATE1 &TESTDATE2


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
Member
posted Hide Post
The final solution:


-SET &TODAY = &YYMD;
-SET &LASTDT= &TODAY - 7;
-SET &LASTSUND = DATEMOV(&LASTDT, BOW);
-SET &LASTSAT = &LASTSUND +6;
-SET &STARTDATE = CHGDAT('YYMD', 'MDYY', &LASTSUND, 'A8');
-SET &ENDINGDATE = CHGDAT('YYMD', 'MDYY', &LASTSAT, 'A8');



DEFINE FILE OTISQA_INVENTORY_CURRENT_VW
BEGINDATE/MDYY=&STARTDATE;
ENDDATE/MDYY=&ENDINGDATE;

END

TABLE FILE OTISQA_INVENTORY_CURRENT_VW
PRINT
MILL_COIL_ID
PRODDATE
BEGINDATE
ENDDATE
-*WHERE ( PRODDATE GE BEGINDATE ) AND ( PRODDATE LE ENDDATE );
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
END


Into the Memory Hole!
 
Posts: 9 | Registered: March 16, 2007Report This Post
Virtuoso
posted Hide Post
What you have so far will not work, for several reasons. Try it with today = July 4.

This will do it:

SET TESTDATE = 20070704
-RUN

-SET &_1NOW= &YYMD;
-SET &_2DOW= DOWK(&_1NOW,'A3');
-SET &_3DOW= DECODE &_2DOW(MON 1, TUE 2, WED 3, THU 4, FRI 5, SAT 6,
- ELSE 0);
-SET &_4SUN= AYMD(&_1NOW,-(7+&_3DOW), 'I8YYMD');
-SET &_5SAT= AYMD(&_4SUN,+6, 'I8YYMD');
-? &_


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Master
posted Hide Post
To get the previous Sat and Sun use the following:

-SET &DAYS=IF &DATEW EQ 7 THEN 0 ELSE 0-&DATEW;
-SET &LASTSAT=AYMD(&YYMD,&DAYS-1,'I8');
-SET &LASTSUN=AYMD(&LASTSAT,-6,'I8');

What you are doing:

-SET &LASTSAT = &LASTSUND +6;

will not work if the Sun to Sat crosses from one month to the next.


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
Virtuoso
posted Hide Post
I would instead of changing the &LASTSUND to a MDYY date, change the PRODDATE to a YYMD format.
The formula is the same, but this can be done in a define.

NEWPROD/YYMD=CHGDAT('MDYY','YYMD'',PRODDATE,NEWPROD);

The advantage is that you now have a date that sorts better (a higher 'number' is a higher 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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Follow on to Chanllenge: Date Convert

Copyright © 1996-2020 Information Builders