Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     calculation of Dates for Current Month
Go
New
Search
Notify
Tools
Reply
  
calculation of Dates for Current Month
 Login/Join
 
Silver Member
posted
Iam working on a Aging Report that needs a Tempory Field to sort horizantaly.The Field want to display current month Dates MDYY format.
For Example For Jan '08
01/01/08
01/02/08
01/03/08
01/04/08
01/05/08
01/06/08
.
.
.
etc

any suggestions would be great

Thanks in Advance,
Saikumar.


WebFOCUS 8103 Appstudio, Dev Studio MRE
Client Windows 7, Serveron Unix.
Excel, PDF, HTML,AHTML
 
Posts: 38 | Registered: January 24, 2008Reply With QuoteReport This Post
Expert
posted Hide Post
Saikumar,

Create a FOCUS file and load it with a range of dates as required.
FILEDEF DATEMAS DISK DATERNG.MAS
-RUN
-WRITE DATEMAS FILE=DATERNG,SUFFIX=XFOC
-WRITE DATEMAS SEGNAME=SEG1
-WRITE DATEMAS FIELD=DATE_KEY, ,DMYY ,DMYY , $
-RUN
CREATE FILE DATERNG
MODIFY FILE DATERNG
FREEFORM DATE_KEY.A8.
LOG FORMAT MSG OFF
LOG TRANS MSG OFF
LOG INVALID MSG OFF
DATA
-* Any invalid dates will be rejected.
-DEFAULT &Year  = 2008
-SET &Year  = EDIT(&YYMD,'9999$');
-SET &Month = EDIT(&YYMD,'$$$$99$');
-SET &Month = &Month * 1;
-SET &Day   = 1;
-REPEAT :Loop1 31 TIMES;
-SET &Date = IF &Day LT 10 THEN '0' || &Day ELSE &Day;
-SET &Mnth = IF &Month  LT 10 THEN '0' || &Month ELSE &Month;
&Date&Mnth&Year
-SET &Day = &Day + 1;
-:Loop1
END
-RUN
TABLE FILE DATERNG
PRINT *
END

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: 5687 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Silver Member
posted Hide Post
Thanks Tony,for your time
Your's code id working fine ,I took part of your code.
now I have list of weekends in DATERNG TABLE.
Can I use this table to filterout weekends in MY CURRENT table ?

Thanks again Tony
Saikumar


WebFOCUS 8103 Appstudio, Dev Studio MRE
Client Windows 7, Serveron Unix.
Excel, PDF, HTML,AHTML
 
Posts: 38 | Registered: January 24, 2008Reply With QuoteReport This Post
Expert
posted Hide Post
Think about it logically - you want to remove Saturday and Sunday dates from your table?

Well using the DOWK routine is a big clue so see if you can work it out?

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: 5687 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Platinum Member
posted Hide Post
This might be simpler for you if you don't mind using ggsales sample table.
-DEFAULT &start_date  = '20120401';
-DEFAULT &num_of_days = 30;
 APP PATH IBISAMP
 TABLE FILE GGSALES
 SUM COMPUTE DATEYYMD/YYMD = IF LAST DATEYYMD EQ 0 
                             THEN '&start_date' 
                             ELSE LAST DATEYYMD + 1;
    BY SEQ_NO NOPRINT
 WHERE SEQ_NO LE &num_of_days
 ON TABLE HOLD AS DATELIST FORMAT FOCUS
 END


WF 8.2.06
Win10 / IE11
AHTML EXL2K PDF
 
Posts: 181 | Registered: October 19, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     calculation of Dates for Current Month

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.