printing months with days and date.

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
shashi1981
Member
Posts: 3
Joined: Sat Apr 21, 2007 3:55 pm
Location: new Delhi

printing months with days and date.

Post by shashi1981 » Sun Apr 22, 2007 5:18 pm

I want to print three month calendar with days and dates.
for example - Jan, feb, march.
there are seven columns and seven rows for this. in the first rows all days will come as like mon, tue, wed, thur, fri, sat, sun. in others rows all the dates will come one by one. in the blank spaces "*" is required to fill.
in this manner i want to print three months calendar with days and dates.

can anyone help me regarding this problem. I will appreciate your help.
thanks and regards.
shashi dubey.
new delhi.

Veera
Moderator
Posts: 111
Joined: Wed Feb 22, 2006 2:59 pm

Post by Veera » Sat Jul 14, 2007 1:25 am

Shashi dubey,

Well I can give you some pointers as how to proceed. well we cant give you the exact code

as your requirement is not complete....

Things like

1 -> Are you trying to print for specific months

2 -> Only for a period of 3 mnts

3 -> DO we have info reg the start and end-dates and the day like sun, mon..and so on...


But i am pretty sure we can achieve what you have asked for


Code: Select all

What we need to do is you need to declare a 2 dimensional TABLE in a COBOL pgm.

1 dimension for the column 
1 dimension of  the row

1 -> To get the const headers like MON,TUE ...initialize the table when the index is 

     (1,1) , (1,2) (1,3) ...so on until the COLUMN index reached 7 and the row index  is const 1.


2 -> For printing the days just increments the counters accordingly 1 to 7 for each row and have a working storage variable and increment it for each time as you increment the column counter for printing the days.

( For this we need to know the start-date and end-date and also starting day and ending day as whether it is sun,mon or so on....

3->  Once you reach the max days for a month , then on...initialize the  table again with stars.


NOTE : If we need to achieve the printing of the months dynamically for any given month
then we need to get the pre-requisites like start-day, end-day....no of days
and the info regarding the start day and end day falls on which day of the week using
some cobol functions or getting the info lile curr date and time from the system.

If you have any questions regarding the approach let us know.

Thanks,
Veera.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others