Focal Point
calculation of Dates for Current Month

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4111061003

September 22, 2008, 07:42 AM
saikumar
calculation of Dates for Current Month
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
September 22, 2008, 08:21 AM
Tony A
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 
September 24, 2008, 07:40 AM
saikumar
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
September 24, 2008, 08:22 AM
Tony A
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 
June 26, 2012, 10:51 AM
dbeagan
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



WebFOCUS 8.2.06