Listing of program /html/rsp/rsptest3.rsp


/*-- RSP ---------------------------------------------------------------------*/
/*                                                                            */
/* Module:      rsptest3.rsp                                                  */
/*                                                                            */
/* Version:     1.1.1                                                         */
/*                                                                            */
/* Author:      W. David Ashley                                               */
/*                                                                            */
/* Description: Test RSP page. Prints the current month's calendar.           */
/*                                                                            */
/* Copyright (C) International Business Machines Corporation and others.      */
/* All Rights Reserved.                                                       */
/*                                                                            */
/* This software is subject to the terms of the Common Public License. You    */
/* must accept the terms of this license to use this software. Refer to       */
/* the file CPLv1.0.htm included in this package for more information.        */
/*                                                                            */
/* The program is provided "as is" without any warranty express or implied,   */
/* including the warranty of non-infringement and the implied warranties of   */
/* merchantibility and fitness for a particular purpose. IBM will not be      */
/* liable for any damages suffered by you as a result of using the Program.   */
/* In no event will IBM be liable for any special, indirect or consequential  */
/* damages or lost profits even if IBM has been advised of the possibility of */
/* their occurrence. IBM will not be liable for any third party claims        */
/* against you.                                                               */
/*                                                                            */
/* Modifications:                                                             */
/*                                                                            */
/* Date       Author      Description                                         */
/* ---------- ----------- --------------------------------------------------- */
/* 2002/06/01 WD Ashley   v1.1.0 Initial Public Release                       */
/* 2002/06/30 WD Ashley   v1.1.1 Changed the license reference only.          */
/*                                                                            */
/*----------------------------------------------------------------------------*/
?>

















sdate = date('S')
cdate = substr(sdate, 7) + 0
month = date('M', sdate, 'S') || ' - ' || substr(sdate, 1, 4)
startday = (date('B', substr(sdate, 1, 6) || '01', 'S') // 7) + 2
if startday > 7 then startday = startday - 7
lastsdate = substr(sdate, 1, 6) || '01'
if substr(lastsdate, 5, 2) = '12' then ,
 nextsdate = (substr(lastsdate, 1, 4) + 1) || '0101'
else nextsdate = substr(lastsdate, 1, 4) || ,
 right(substr(lastsdate, 5, 2) + 1, 2, '0') || '01'

days = date('B', nextsdate, 'S') - date('B', lastsdate, 'S')

/* output the table headers */












/* output the table contents */
day = 0
do i = 1 to 6
   if day >= days then iterate

   do j = 1 to 7

      if i = 1 then do
         if j >= startday then day = day + 1
         end
      else day = day + 1
      if day = 0 | day > days then say ' '
      else do

         else say day
         end

      end

   end