%%$WCALC

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

The valid syntax for %%$WCALC in MFBSI is:

%%$WCALC date instruction calendarName

where:

date
A valid date, CCYYMMDD, (constant or resolved variable), in the range of 1700/01/01 and 2054/12/31.
instruction
Valid values:
+nnn
Max 3-digit number between 1-366 or a Control-M variable.
-nnn
Max 3-digit number between 1-366 or a Control-M variable
> | <
calendarName
The name of the calendar, calendarName must be a maximum of eight characters. This is case-sensitive on UNIX and Linux platforms.

Specifying the location of the calendar

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

  • Using CTM_CALENDAR:

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

     $CTM_CALENDAR\Yccyy\calendarName.CLD

    where:

    $CTM_CALENDAR
    The environment variable that 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
    The mandatory file extension. On UNIX, this must be in upper-case.
  • Using the Enterprise Server JCL catalog:

    Use the enterprise server JCL catalog to define a dynamic PDS with the following attributes: PO, LRECL=1024, LSEQ, EXTS=CLD.

    The PDS name is: ESCTM.CALENDAR.Yccyy; 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 (line sequential) text file. The following formats are supported:

Format 1
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.

    For 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>
    Note: If the calendar is extracted from Control-M Distributed, the following text format is expected:
    <?xml version='1.0' encoding='ISO-8859-1' ?>
    <!DOCTYPE DEFCAL SYSTEM "defcal.dtd">
    <DEFCAL >
         <CALENDAR DATACENTER="PR -D027" NAME="CLD01" TYPE="Regular">
         <YEAR DAYS="NYYNNN.......................NNNYYYY" 
    DESCRIPTION="FIESTAS = DIARIO" NAME="2020"/>
         </CALENDAR>
    </DEFCAL>
Format 2
Use a text file with the following layout:
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

The mandatory declaration, ** MFBSI CTM Calendar, must be on the first line.

Note: After the first line, any spacey lines or lines starting with "*" (comment) are ignored.

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 in the month.
  • Lines (2) and (3) - 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. 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 - 1024 - 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 - 1024 - Dynamic - Ext:CLD