%%$WCALC

MFBSI supports the Control-M function %%$WCALC which requires one or more Control-M Calendar definitions.

Syntax and usage

The syntax for %%$WCALC is:

%%$WCALC ????? +|-nnn CalendarName
         |     >|<    |           
         |      |     |           
         |      |     part3    
         |     part2           
         part1                 

Where:

part 1
A valid date, CCYYMMDD, (constant or variable), in the range of 1700/01/01 and 2054/12/31.
part 2
One of the following operators: plus (+), minus (-), greater than (>), or smaller than (<).

'+' or '-' must be followed by a maximum of three digits, nnn, where the number must be equal to or less than 366.

part 3
The name of the calendar, CalendarName - a maximum of eight characters. This is case-sensitive on UNIX and Linux platforms.

Location of the calendar file

You can specify the location of the calendar in one of the following ways:

Option 1:

Use the environment variable CTM_CALENDAR to locate your calendar for Yccyy. The full calendar location is:

$CTM_CALENDAR\Yccyy\CalendarName.CLD

Where:

  • $CTM_CALENDAR - an environment variable which specifies the base location for the calendars.
  • Yccyy - the year (such as 2019, 2020, etc.) prefixed by Y.
  • CalendarName - the name of the calendar. The name must have a maximum of eight characters and is case-sensitive on UNIX and Linux platforms.
  • .CLD - a mandatory file extension. On UNIX, this must be in upper-case characters.

Option 2:

Use the Enterprise Server JCL Catalog to define a dynamic PDS (PO / LRECL=80 / LSEQ / EXTS=CLD).

The PDS name is: ESCTM.CALENDAR.Yccyy, where ccyy indicates the century and the year - for example, ESCTM.CALENDAR.Y2010.

The member names are set to the CalendarName to be used with the .CLD extension.

Calendar format

The MFBSI calendars are stored in a text file (line sequential). The following formats are supported:

Format 1:

This is the format obtained from an XML export of the Control-M z/OS calendar. The following rules apply:

  • The first record of the calendar starts with the <DEFCAL> declaration in column 1.
  • Only one calendar is allowed per file (member).
  • In the DAYS string, "Y" indicates a working day, and "N" indicates a non-working day.

Example:

<DEFCAL>
  <CALENDAR DATACENTER="ECS5NY" NAME="AcctCal3" TYPE="Regular">
  <YEAR NAME="2008" DAYS="YYYYYYYYYYYYYYYYYYNYYYYYYYYYYYYYYYYYYY
                          YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
                          YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYNNNYYYYYYYY
                          YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
                          YYYYNNYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
                          YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
                          YYYYYYYYYYYYYYYYYYYYYYYYYYYYYNYYYYYYYYYYYYYY
                          YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYNNNY
                          YYYYYYYYYYYYYYYYYYYY"
                    DESCRIPTION="Calendar for 2008.”/>
  </CALENDAR>
</DEFCAL> 

Format 2:

You can use a text file with the layout specified below.

The following example is for a file named $CTM_CALENDAR|2021|BSICLD01:

** MFBSI CTM Calendar
** Year:     2021
** Calendar: BSICLD01
** “S” column represents “Sunday”

*  -S------S------S------S------S------S
                  1111111111222222222233
         1234567890123456789012345678901
01       YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

*  -S------S------S------S------S------S
              1111111111222222222
     1234567890123456789012345678
02   YYYYYYYYYYYYYYYYYYYYYYYYYYYY

*  -S------S------S------S------S------S
              1111111111222222222233
     1234567890123456789012345678901
03   YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

*  -S------S------S------S------S------S
                 111111111122222222223
        123456789012345678901234567890
04      YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

*  -S------S------S------S------S------S
            1111111111222222222233
   1234567890123456789012345678901
05 YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

*  -S------S------S------S------S------S
               111111111122222222223
      123456789012345678901234567890
06    YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

*  -S------S------S------S------S------S
                 1111111111222222222233
        1234567890123456789012345678901
07      YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

*  -S------S------S------S------S------S
             1111111111222222222233
    1234567890123456789012345678901
08  YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

*  -S------S------S------S------S------S
                111111111122222222223
       123456789012345678901234567890
09     YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

*  -S------S------S------S------S------S
                  1111111111222222222233
         1234567890123456789012345678901
10       YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

*  -S------S------S------S------S------S
              111111111122222222223
     123456789012345678901234567890
11   YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

*  -S------S------S------S------S------S
                1111111111222222222233
       1234567890123456789012345678901
12     YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

Where:

  1. The first line must include the following declaration:
    ** MFBSI CTM Calendar
  2. After the first line, any spacey lines or lines starting with "*" (comment) are ignored.
  3. The following lines are used to easily identify how to handle days in a given month.
    (1)		*  -S------S------S------S------S------S
    (2)		*            1111111111222222222233
    (3)		*   1234567890123456789012345678901
    (4)		12  YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

    Line (1) - "S" indicates the Sundays of the month.

    Lines (2) and (3) - indicate the days of the month, 1 to a maximum of 31.

    Line (4) - "12" indicates December. The characters set the working days in the month where a "Y" indicates a working day and an "N" indicates a non-working day.

Creating the calendar

  1. Before using the mfbsijcl command, set or export the CTM_CALENDAR environment variable to the path under which the calendar will be defined.

    Optionally, you can define a dynamic PDS in the Enterprise Server catalog using ESMAC or ESCWA.

  2. After setting this, use the following command to automatically create a base calendar file for the year CCYY where all days are available:
    mfbsijcl /calendar CalendarName CCYY
  3. In the generated file, replace any "Y" with an "N" for the non-working days of the specified year.

For example:

DSN	ESCTM.CALENDAR.Y1999
File	D:\MF\ES\MFBSI\CTMCalendar\Y1999
DCB	PO - LSEQ - ASCII - 80 - Dynamic - Ext:CLD

The output from the execution of the mfbsijcl command is as follows:

set CTM_CALENDAR=D:\MF\ES\MFBSI\CTMCalendar	(Windows)
export CTM_CALENDAR= MF/ES/MFBSI/CTMCalendar	(UNIX)
mfbsijcl /calendar EXCPCAL1 1999
------------------------------------------------------------
JCLSI0001I MFBSI Version 5.0.08  Copyright (C) 2013-2020 ... 

MFBSI Calendar definition

  Calendar path = D:\MF\ES\MFBSI\CTMCalendar
  Calendar year = 1999
  Calendar name = EXCPCAL1

  Calendar created in: D:\MF\ES\MFBSI\CTMCalendar\Y1999\EXCPCAL1.CLD  (Win)
  Calendar created in: MF/ES/MFBSI/CTMCalendar/Y1999/EXCPCAL1.CLD     (UX) 

  May be defined in your ES Catalog using:
    DSN=ESCTM.CALENDAR.Y1999
    File=D:\MF\ES\MFBSI\CTMCalendar\Y1999
    DCB: PO - LSEQ - ASCII - 80 - Dynamic - Ext:CLD