## CCMS (file)

Prisma supports ingest of CCMS ad schedules files (.SCH). This file is generally generated by a T\&B System (Traffic & Billing System).

.SCH files follow a strict filename structure, as well as file structure.

### Filename structure

.SCH files follow the following structure: `MDDNNHHH.SCH`

<table>
  <thead>
    <tr>
      <th style="text-align: left">File name partition</th>
      <th style="text-align: left">Definition</th>
      <th style="text-align: left">Example</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: left">M</td>
      <td style="text-align: left">Month of intended airing – hexadecimal format, from 1 to C</td>
      <td style="text-align: left">1 = January C = December</td>
    </tr>
    <tr>
      <td style="text-align: left">DD</td>
      <td style="text-align: left">Day of month of intended airing – decimal format, from 01 to 31</td>
      <td style="text-align: left">-</td>
    </tr>
    <tr>
      <td style="text-align: left">NN</td>
      <td style="text-align: left">Identifies the network within a single headend – numeric format, from 01 to 99 (01 to U9 with extensions).</td>
      <td style="text-align: left">18<br>P8 (258 in decimal)</td>
    </tr>
    <tr>
      <td style="text-align: left">HHH</td>
      <td style="text-align: left">Numeric representation of the headend/zone, range from 001 to 999</td>
      <td style="text-align: left">44</td>
    </tr>
  </tbody>
</table>

_Filename example_: `822P8044.sch`

### Ad Schedule structure

Ad schedule files are organized in records (one line per record), and contain 24 hours of data, from midnight to midnight. Each field of a record is determined by its byte position. An example (subset) of .SCH file is given below:

_Example_: `C2401002.sch`

```text
REM Schedule file for channel 1 for 12/24/96 (C2401002.sch)
LOI 1224 085900 0829 0100 001 001 000030 000000 00000000 000 00000002303 0000
LOI 1224 085930 0829 0100 001 002 000030 000000 00000000 000 00000234500 0000
LOI 1224 095900 0929 0100 002 001 000030 000000 00000000 000 00000015601 0000
LOI 1224 095930 0929 0100 002 002 000030 000000 00000000 000 00000002303 0000
LOI 1224 105900 1029 0100 003 001 000030 000000 00000000 000 00000234500 0000
…
```

A description of the different fields is provided in the following table:

<table>
  <thead>
    <tr>
      <th style="text-align: left">Field #</th>
      <th style="text-align: left">Name</th>
      <th style="text-align: left">Bytes position</th>
      <th style="text-align: left">Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: left">1</td>
      <td style="text-align: left">Event Type</td>
      <td style="text-align: left">1-3 (3 chars)</td>
      <td style="text-align: left">Type of event defined by record: LOI: Local Originated Insertion REM: Remark, no action END: Last record (optional) NUL: Ignore break cue</td>
    </tr>
    <tr>
      <td style="text-align: left">2</td>
      <td style="text-align: left">Scheduled date</td>
      <td style="text-align: left">5-8 (4 chars)</td>
      <td style="text-align: left">Date when the event will occur Format: MMDD e.g.: 1025</td>
    </tr>
    <tr>
      <td style="text-align: left">3</td>
      <td style="text-align: left">Scheduled time</td>
      <td style="text-align: left">10-15 (6 chars)</td>
      <td style="text-align: left">T&amp;B’s approximate time of the day the event will occur Format: HHMMSS e.g.: 131545</td>
    </tr>
    <tr>
      <td style="text-align: left">4</td>
      <td style="text-align: left">Window start time</td>
      <td style="text-align: left">17-20 (4 chars)</td>
      <td style="text-align: left">Time of the day the opportunity becomes eligible for evaluation Format: HHMM</td>
    </tr>
    <tr>
      <td style="text-align: left">5</td>
      <td style="text-align: left">Window duration</td>
      <td style="text-align: left">22-25 (4 chars)</td>
      <td style="text-align: left">Duration during which the opportunity remains eligible Format: HHMM</td>
    </tr>
    <tr>
      <td style="text-align: left">6</td>
      <td style="text-align: left">Break number within window</td>
      <td style="text-align: left">27-29 (3 chars)</td>
      <td style="text-align: left">Break number within the window of opportunity. Valid break starts at 001</td>
    </tr>
    <tr>
      <td style="text-align: left">7</td>
      <td style="text-align: left">Position number within break</td>
      <td style="text-align: left">31-33 (3 chars)</td>
      <td style="text-align: left">Position within the ad break Valid position starts at 001</td>
    </tr>
    <tr>
      <td style="text-align: left">8</td>
      <td style="text-align: left">Scheduled length 35-40</td>
      <td style="text-align: left">(6 chars)</td>
      <td style="text-align: left">Scheduled event length Format: HHMMSS</td>
    </tr>
    <tr>
      <td style="text-align: left">9</td>
      <td style="text-align: left">Actual aired time</td>
      <td style="text-align: left">42-47 (6 chars)</td>
      <td style="text-align: left">Actual aired time of day Format: HHMMSS</td>
    </tr>
    <tr>
      <td style="text-align: left">10</td>
      <td style="text-align: left">Actual aired length</td>
      <td style="text-align: left">49-56 (8 chars)</td>
      <td style="text-align: left">Actual aired length Format: HHMMSSCC</td>
    </tr>
    <tr>
      <td style="text-align: left">11</td>
      <td style="text-align: left">Actual aired position within break</td>
      <td style="text-align: left">58-60 (3 chars)</td>
      <td style="text-align: left"> </td>
    </tr>
    <tr>
      <td style="text-align: left">12</td>
      <td style="text-align: left">Spot identification</td>
      <td style="text-align: left">62-72 (11 chars)</td>
      <td style="text-align: left">T&amp;B’s spot identification code.</td>
    </tr>
    <tr>
      <td style="text-align: left">13</td>
      <td style="text-align: left">Completion status code</td>
      <td style="text-align: left">74-77 (4 chars)</td>
      <td style="text-align: left">Completion status code</td>
    </tr>
    <tr>
      <td style="text-align: left">14</td>
      <td style="text-align: left">Advertiser name</td>
      <td style="text-align: left">79-110 (32 chars)</td>
      <td style="text-align: left"><em>Optional</em> - Advertiser’s name as defined in the T&amp;B</td>
    </tr>
    <tr>
      <td style="text-align: left">15</td>
      <td style="text-align: left">Advertiser spot name</td>
      <td style="text-align: left">112-131 (20 chars)</td>
      <td style="text-align: left"><em>Optional</em> - Advertiser’s spot name as defined in the T&amp;B</td>
    </tr>
    <tr>
      <td style="text-align: left">16</td>
      <td style="text-align: left">Schedule/Fill</td>
      <td style="text-align: left">133-136 (4 chars)</td>
      <td style="text-align: left"><em>Optional</em> - Identifies the spot being: - Contractually scheduled (sch.) - Used as filler (Fill)</td>
    </tr>
  </tbody>
</table>

### Import a .SCH file

To configure .SCH import, follow these steps:

1. Add a **Viewing Policy Manager** service.

2. Configure a name.

3. In the **Input** tab, select **CCMS (file)** as **Import type**.

4. Configure the following settings.

   <table>
     <thead>
       <tr>
         <th style="text-align: left">Parameter</th>
         <th style="text-align: left">Description</th>
       </tr>
     </thead>
     <tbody>
       <tr>
         <td style="text-align: left">Provider ID</td>
         <td style="text-align: left">This field is used to identify the content provider.<br><em>Example</em>: <code>Provider1</code></td>
       </tr>
       <tr>
         <td style="text-align: left">Time zone</td>
         <td style="text-align: left">Define the time zone of the ingested schedule file.</td>
       </tr>
     </tbody>
   </table>

5. Select **Save and exit** to save the configuration and return to **Services**.

6. Assign a server to run your service to start the service.

7. To load your .SCH file, select `Clock` icon on the top right corner of the input tab page then select the **Import SCH File (CCMS)** button;

8. Select your .SCH file then select **Ok**.

   Once loaded, events will be displayed in the timeline, grouping records belonging to the same ad break within a single viewing policy. A stream conditioning service can then be configured to access these events normalized in SCTE-224 and convert them into ESAM-based control.

## CCMS (Watch folder)

Watch folder directories must be created during installation (see Installation guides).

1. Add a **Viewing Policy Manager** service.
2. Configure a name.
3. In the **Input** tab, select **CCMS watch folder** as **Import type**.
4. Configure the following settings.

   <table>
     <thead>
       <tr>
         <th style="text-align: left">Parameter</th>
         <th style="text-align: left">Description</th>
       </tr>
     </thead>
     <tbody>
       <tr>
         <td style="text-align: left">Provider ID</td>
         <td style="text-align: left">This field is used to identify the content provider.</td>
       </tr>
       <tr>
         <td style="text-align: left">Time zone</td>
         <td style="text-align: left">Define the time zone of the ingested schedule file.</td>
       </tr>
       <tr>
         <td style="text-align: left">Watch folder period</td>
         <td style="text-align: left">Define the period when the VPM checks the watch folder for new files.<br> <em>Example</em>: 60 sec</td>
       </tr>
     </tbody>
   </table>
