getcalENDAR command


GETCALENDAR

Command:

GETCALENDAR

Syntax:

GETCALENDAR USING <year-input> <month-input> <calendar-target-variable>.

Description:

The GETCALENDAR command places a calendar for a given year year-input and a given month month-input into a target group item variable calendar-target-variable. The year-input and month-input should be numeric values; if they are variables, their variable declarations must have numeric picture clauses. Any fractional component to year-input or month-input will be ignored, e.g., a month-input of 11.88 will be processed as 11.

GETCALENDAR does not support pre-Julian calendar dates, i.e., any date prior to August 1752.

To work properly, GETCALENDAR requires that the calendar-target-variable be defined as a group item with 8 elementary items. See the Example Usage below.

Example Usage:

1 year_var PIC 9(4) VALUE 2001.

1 month_var PIC 99 VALUE 1.

1 calendar_group.

5 calendar_line1 PIC X(30).

5 calendar_line2 PIC X(30).

5 calendar_line3 PIC X(30).

5 calendar_line4 PIC X(30).

5 calendar_line5 PIC X(30).

5 calendar_line6 PIC X(30).

5 calendar_line7 PIC X(30).

5 calendar_line8 PIC X(30).

GETCALENDAR USING 2001 1 calendar_group.

DISPLAYLF calendar_group.

GETCALENDAR USING year_var month_var calendar_group.

DISPLAYLF calendar_group.

See Also:

CALENDAR

Sample Program:

GETCAL.CBL