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] Substituting the start and end dates in a procedure

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Substituting the start and end dates in a procedure
 Login/Join
 
Gold member
posted
I need to generate the start and end dates form the system dates. The reason is to use Report Caster to generate reports at the beginning of the month.
The query
TABLE FILE RFIFLTREC
PRINT FR_OOS_DUR
FR_CLOSE_DATE
FR_CLRCAT
FR_DIGITAL
WHERE FR_CLOSE_DATE GE '&SELFROM' AND FR_CLOSE_DATE LT '&SELTO'
END

The close date is A8( i.e. 20060501) format in the master file.
The requirement is to look at the system date on the 5th of the month i.e 20060605 and get the system to generate 20060501 as start date and 20060531 as the end date

Any ideas

This message has been edited. Last edited by: Kerry,


Webfocus 7.6.2 on Windows Enterprise 2003 Server and
Webfocus 7.6.2 on HP Unix Server
 
Posts: 74 | Location: London | Registered: January 28, 2005Report This Post
Expert
posted Hide Post
Hi Adolf,

Quick off the top of the head suggestion would be to use the DATEMOV function, something like -

-SET &BegDate = DATEMOV(&YYMD, 'BOM', 'A8YYMD');
-SET &EndDate = DATEMOV(&YYMD, 'EOM', 'A8YYMD');


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
I think that the datemov function only works with smart dates. If you always want the first and last calendar days of the previous month based on the current system date, this will probably work for you.

The following code:

-SET &BEGCURR = EDIT(&YYMD,'99999901');
-SET &ENDDATE = AYMD( &BEGCURR, -1 , 'I8YYMD');
-SET &BEGDATE = EDIT( &ENDDATE,'99999901');
-TYPE &BEGDATE &ENDDATE

Yields this result.

20060501 20060531


FOCUS 7.6 MVS PDF,HTML,EXCEL
 
Posts: 115 | Location: Chicago, IL | Registered: May 28, 2004Report This Post
Virtuoso
posted Hide Post
This works too.
DEFINE FILE CAR
TODAY/MDYY = '&DATEMDYY';
BEG_CUR_MO/MDYY=DATEMOV(TODAY,'BOM');
END_CUR_MO/MDYY=DATEMOV(TODAY,'EOM');
BEG_PRIOR_MO/MDYY=DATEADD(BEG_CUR_MO,'M',-1);
END_PRIOR_MO/MDYY=DATEMOV(BEG_PRIOR_MO, 'EOM');
END
TABLE FILE CAR
PRINT CAR NOPRINT
TODAY
BEG_CUR_MO
END_CUR_MO
BEG_PRIOR_MO
END_PRIOR_MO
END


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Expert
posted Hide Post
So does this:

-SET &MTDF = DATECVT( DATEMOV(DATECVT(&YYMD,'I8YYMD','YYMD'),'BOM'),'YYMD','I8YYMD');

The innermost DATECVT function call converts the integer value &YYMD to a smart date. Then the DATEMOV function runs and then the outermost DATECVT function converts the smart date back to an integer.


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
FYI,

The issue has been resolved on Adolf's side, so many thanks to everyone's input. Smiler

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
Member
posted Hide Post
I ended up going for PBrightwell's solution. It works like a charm.

Thank you everybody for your help.

Rafael

BTW - I ordered the 1001 ways to work with dates book. This seemingly simple stuff was driving me crazy.
 
Posts: 9 | Location: Memphis, TN | Registered: March 09, 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] Substituting the start and end dates in a procedure

Copyright © 1996-2020 Information Builders