Previous Topic: Keywords on the Schedule Manager API QUERY CommandNext Topic: Keywords on All Other Schedule Manager API Commands


Formats of All Other Schedule Manager API Commands

Examples given in this section were generated by calling the following REXX program named SM$API to call the Schedule Manager API and display the results at the terminal:

/*------------------------------------------------------------------*/
/*  REXX test ASOSMAPI API calls.                                   */
/*--+----1----+----2----+----3----+----4----+----5----+----6----+---*/
/*                                                                  */
  PARSE UPPER ARG sm_api_parms
  CALL ASOSMAPI sm_api_parms
  SAY 'SM$API Result='result
EXIT result

Program SM$API above was called by issuing the following command from the ISPF command shell on a TSO userid logged on to a system with a single copy of CA OPS/MVS running:

OI SM$API arg

Argument arg in the above command text contains the command syntax to call Schedule Manager, documented below.

For more information on the OI command, see OPSIMEX Command Processor in the chapter “POI Command Processors” in the Command and Function Reference.

Syntax to copy a schedule on the local system:

COPY
   {SCHEDULE(ssss)}
   {TARGET(tttt)}

Copy schedule ssss to schedule tttt. Schedule tttt is deleted before the copy is made so that schedule tttt is identical to schedule ssss after the copy.

Example: copy schedule on the local system

Command (and response) to copy schedule PRODUCTION on the local system to schedule TEST_IMAGE on the local system:

OI SM$API COPY SCHEDULE(PRODUCTION) TARGET(TEST_IMAGE)
SM$API MESSAGE: *COPIED
SM$API Result=0
***

Syntax to create an empty schedule:

Create
   {SCHEDULE(ssss)}

Example: Create empty schedule

Command (and response) to create empty schedule TEST_EMPTY on the local system:

OI SM$API CREATE SCHEDULE(TEST_EMPTY)
SM$API MESSAGE: *CREATED
SM$API Result=0
***

Syntax to delete a schedule on the local system:

DELETE
   {SCHEDULE(ssss)}

Example: Delete schedule on local system

Command (and response) to delete schedule TEST_IMAGE on the local system:

OI SM$API DELETE SCHEDULE(TEST_IMAGE)
SM$API MESSAGE: *DELETED
SM$API Result=0
***

Syntax to insert empty period in the schedule

INSERT
   {SCHEDULE(ssss)}
   {PERIOD(pppp)}
   {DATE(dddd)}
   {TIME(tttt-uuuu)}

Insert (create) empty period pppp in schedule ssss on the local system, active on days dddd with a start time of tttt and end time of uuuu.

Example: Insert empty period in schedule

Command (and response) to insert empty period WENDALL in schedule TEST_EMPTY on the local system, active all day Saturday and Sunday:

OI SM$API INSERT SCHEDULE(TEST_EMPTY) PERIOD(WENDALL)
                 DATE(S.....S) TIME(0000-2400)
SM$API Result=0
***

Syntax to create a link in the schedule

LINK
   {SCHEDULE(ssss)}
   {PERIOD(pppp)}
   {TABLE(tttt)}
   {RESOURCE(rrrr)}
   {DESIRED_STATE(dddd)}

Create a link in schedule ssss between period pppp and resource rrrr in table tttt with a DESIRED_STATE of dddd.

Example: Create a link in schedule

Command (and response) to create a link in schedule TEST_EMPTY on the local system between period WENDALL and resource JES2 in table JES2_STCTBL with a DESIRED_STATE of ON:

OI SM$API LINK SCHEDULE(TEST_EMPTY) PERIOD(WENDALL)
               TABLE(JES2_STCTBL) RESOURCE(JES2)
               DESIRED_STATE(ON)
SM$API Result=0
***

Syntax to create links in the schedule:

LINK_COPY
   {SCHEDULE(ssss)}
   {PERIOD(pppp)}
   {TARGET_PERIOD(tttt)}

Create links in schedule ssss between period tttt and all of the same resources that are linked to period pppp.

Example: Create links in schedule

Command (and response) to create links in schedule PRODUCTION on the local system between period EVERYNOON and all of the same resources that are linked to period DEFAULT:

OI SM$API LINKS_COPY SCHEDULE(PRODUCTION) PERIOD(DEFAULT)
                     TARGET_PERIOD(EVERYNOON)
SM$API Result=0
***

Syntax to create links to a schedule:

LINK_COPY
   {SCHEDULE(ssss)}
   {TABLE(tttt)}
   {RESOURCE(rrrr)}
   {TARGET_TABLE(aaaa)}
   {TARGET_RESOURCE(cccc)}

Create links in schedule ssss between resource cccc in table aaaa and all of the same periods that are linked to resource rrrr in table tttt.

Example: Create links to schedule

Command (and response) to create links to schedule TEST_EMPTY on the local system between resource DB2 in table DB2_STCTBL and all of the same periods that are linked to resource JES2 in table JES2_STCTBL:

OI SM$API LINKS_COPY SCHEDULE(TEST_EMPTY)
                    TABLE(JES2_STCTBL) RESOURCE(JES2)
                    TARGET_TABLE(DB2_STCTBL) TARGET_RESOURCE(DB2)
SM$API Result=0
***

Syntax to delete all links in a schedule:

LINK_DELETE
   {SCHEDULE(ssss)}
   {PERIOD(pppp)}

Delete all links in schedule ssss between all resources and period pppp.

Example: Delete all links in schedule

Command (and response) to delete all links in schedule PRODUCTION on the local system between all resources and period EVERYNOON:

OI SM$API LINKS_DELETE SCHEDULE(PRODUCTION) PERIOD(EVERYNOON)
SM$API Result=0
***

Syntax to delete all links:

LINK_DELETE
   {SCHEDULE(ssss)}
   {PERIOD(pppp)}
   {RESOURCE(rrrr)}

Delete all links in schedule ssss between all periods and resource rrrr in table tttt.

Example: Delete all links

Command (and response) to delete all links in schedule TEST_EMPTY on the local system between all periods and resource DB2 in table DB2_STCTBL:

OI SM$API LINKS_DELETE SCHEDULE(TEST_EMPTY)
                 TABLE(DB2_STCTBL) RESOURCE(DB2)
SM$API Result=0
***

Syntax to load a schedule:

LOAD
   {SCHEDULE(ssss)}
   {TARGET(ACTIVE)}

Load (activate) schedule ssss by making it the ACTIVE schedule.

Example: Load schedule

Command (and response) to load (activate) schedule PRODUCTION on the local system by making it the ACTIVE schedule on the local system:

OI SM$API LOAD SCHEDULE(DEVELOPMENT) TARGET(ACTIVE)
SM$API MESSAGE: LOAD_SET API RESPONSE (continued...)
SM$API MESSAGE: OPS44R>SLEJO01>16:06:49.286188 GLOBAL0.ATMSM_ACTIVE_OPS44R=()
SM$API MESSAGE: LOAD_SET API RESPONSE (continued...)
SM$API MESSAGE: OPS44R>SLEJO01>16:06:49.370434
                LOBAL0.ATMSM_ACTIVE_OPS44R=(PRODUCTION ON OPS44R)
SM$API MESSAGE: *LOADED
SM$API Result=0 
***

Syntax to merge a schedule:

MERGE
   {SCHEDULE(ssss)}
   {TARGET(tttt)}

Merge schedule ssss and schedule tttt and place the result in schedule tttt.

Example: Merge schedule

Command (and response) to merge schedule TEST_EMPTY on the local system and schedule PRODUCTION on the local system and place the result in schedule PRODUCTION on the local system:

OI SM$API MERGE SCHEDULE(TEST_EMPTY) TARGET(PRODUCTION)
SM$API MESSAGE: *MERGED
SM$API Result=0
***

Syntax to remove a schedule:

REMOVE
   {SCHEDULE(ssss)}
   {PERIOD(pppp)}

Remove period pppp from schedule ssss.

Example: Remove period from schedule

Command (and response) to remove period EVERYNOON from schedule PRODUCTION on the local system:

OI SM$API REMOVE SCHEDULE(TEST_EMPTY) PERIOD(EVERYNOON)
 SM$API Result=0
***

Syntax to print a report of a schedule:

REPORT
   {SCHEDULE(ssss)}
   [DSNAME(dddd)]

Print a report on links between periods and resources in schedule ssss to data set dddd, if specified, or to the default data set if dddd is not specified. For a description of the default data set name, see Printing Schedule Manager Data in this chapter. The report generated by this command is identical to the report generated by the Edit primary command REPORT LINKS.

If this command is successful, then it returns the name of the data set containing the report. If this command is not successful, then it returns a value of 8.

Example: Print a report

Command (and response) to print a report on the links between periods and resources in schedule PRODUCTION on the local system:

OI SM$API REPORT SCHEDULE(PRODUCTION) DSNAME('JOEUSER.TEST.REPORT')
SM$API Result='JOEUSER.TEST.REPORT'
***

The following would be the contents of data set JOEUSER.TEST.REPORT:

Schedule: OPS44R>PRODUCTION ----------- LINKS ------------ 15 Apr 2007

                              * * * PERIOD LIST * * *

  WENDALL     S.....S          0000-2400
  WENDLITE    S.....S          0800-2000
  WENDDARK    S.....S          2000-3200
  WEEKDAY     .MTWTF.          0800-1600
  WEEKEVENING .MTWTF.          1600-2400
  WEEKNIGHT   .MTWTF.          2400-3200
  THNXLITE03  11/27/2007-11/28 0800-2000
  THNXDARK03  11/27/2007-11/28 2000-3200
  XMASLITE03  12/24/2007-12/25 0800-2000
  XMASDARK03  12/24/2007-12/25 2000-3200
  XMASALL03   12/25/2007       0000-2400
  XMASEVERY   12/25            0000-2400
  DEFAULT
 1Schedule: OPS44R>PRODUCTION ----------- LINKS ----------- 15 Apr 2007

                            * * * SORTED BY PERIOD * * *

  Period: DEFAULT
    Table: ACF2_STCTBL
      ACF2               ON

    Table: JES2_STCTBL
      JES2               ON
  Period: THNXDARK03     11/27/2007-11/28 2000-3200
    Table: ACF2_STCTBL
      ACF2               ON

    Table: CICS_STCTBL
      CICS               OFF

    Table: IMS_STCTBL
      IMS                OFF

    Table: JES2_STCTBL
      JES2               ON

    Table: TSO_STCTBL
      TCAS               ON
  Period: THNXLITE03     11/27/2007-11/28 0800-2000
    Table: ACF2_STCTBL
      ACF2               ON

    Table: JES2_STCTBL
      JES2               ON

    Table: TSO_STCTBL
      TCAS               ON
  Period: WEEKDAY        .MTWTF.          0800-1600
    Table: ACF2_STCTBL
      ACF2               ON

    Table: CICS_STCTBL
      CICS               ON
      CICSTEST           OFF

    Table: IMS_STCTBL
      IMS                ON

    Table: JES2_STCTBL
      JES2               ON

    Table: TSO_STCTBL
      TCAS               ON
      TCASTEST           OFF
 1Schedule: OPS44R>PRODUCTION ----------- LINKS ----------- 15 Apr 2007

                            * * * SORTED BY PERIOD * * *

  Period: WEEKEVENING    .MTWTF.          1600-2400
    Table: ACF2_STCTBL
      ACF2               ON

    Table: JES2_STCTBL
      JES2               ON

    Table: TSO_STCTBL
      TCAS               ON
  Period: WEEKNIGHT      .MTWTF.          2400-3200
    Table: ACF2_STCTBL
      ACF2               ON

    Table: CICS_STCTBL
      CICS               OFF

    Table: IMS_STCTBL
      IMS                OFF

    Table: JES2_STCTBL
      JES2               ON

    Table: TSO_STCTBL
      TCAS               ON
  Period: WENDALL        S.....S          0000-2400
    Table: JES2_STCTBL
      JES2               ON
  Period: WENDDARK       S.....S          2000-3200
    Table: ACF2_STCTBL
      ACF2               ON

    Table: CICS_STCTBL
      CICS               OFF

    Table: IMS_STCTBL
      IMS                OFF

    Table: JES2_STCTBL
      JES2               ON

    Table: TSO_STCTBL
      TCAS               ON
 1Schedule: OPS44R>PRODUCTION ----------- LINKS ----------- 15 Apr 2007

                            * * * SORTED BY PERIOD * * *

  Period: WENDLITE       S.....S          0800-2000
    Table: ACF2_STCTBL
      ACF2               ON

    Table: JES2_STCTBL
      JES2               ON

    Table: TSO_STCTBL
      TCAS               ON
  Period: XMASALL03      12/25/2007       0000-2400
    Table: DB2_STCTBL
      DB2                OFF

    Table: TSO_STCTBL
      TCASTEST           OFF
  Period: XMASDARK03     12/24/2007-12/25 2000-3200
    Table: ACF2_STCTBL
      ACF2               ON

    Table: CICS_STCTBL
      CICS               OFF

    Table: IMS_STCTBL
      IMS                OFF

    Table: JES2_STCTBL
      JES2               ON

    Table: TSO_STCTBL
      TCAS               ON
  Period: XMASEVERY      12/25            0000-2400
    Table: CICS_STCTBL
      CICSTEST           OFF
  Period: XMASLITE03     12/24/2007-12/25 0800-2000
    Table: ACF2_STCTBL
      ACF2               ON

    Table: DB2_STCTBL
      DB2                ON

    Table: JES2_STCTBL
      JES2               ON

    Table: TSO_STCTBL
      TCAS               ON
1Schedule: OPS44R>PRODUCTION ----------- LINKS ---------- 15 Apr 2007

                           * * * SORTED BY RESOURCE * * *

  Resource: ACF2_STCTBL.ACF2
    ON  DEFAULT
    ON  THNXDARK03  11/27/2007-11/28 2000-3200
    ON  THNXLITE03  11/27/2007-11/28 0800-2000
    ON  WEEKDAY     .MTWTF.          0800-1600
    ON  WEEKEVENING .MTWTF.          1600-2400
    ON  WEEKNIGHT   .MTWTF.          2400-3200
    ON  WENDDARK    S.....S          2000-3200
    ON  WENDLITE    S.....S          0800-2000
    ON  XMASDARK03  12/24/2007-12/25 2000-3200
    ON  XMASLITE03  12/24/2007-12/25 0800-2000
  Resource: CICS_STCTBL.CICS
    OFF THNXDARK03  11/27/2007-11/28 2000-3200
    ON  WEEKDAY     .MTWTF.          0800-1600
    OFF WEEKNIGHT   .MTWTF.          2400-3200
    OFF WENDDARK    S.....S          2000-3200
    OFF XMASDARK03  12/24/2007-12/25 2000-3200
  Resource: CICS_STCTBL.CICSTEST
    OFF WEEKDAY     .MTWTF.          0800-1600
    OFF XMASEVERY   12/25            0000-2400

Resource: DB2_STCTBL.DB2
    ON  XMASLITE03  12/24/2007-12/25 0800-2000
    OFF XMASALL03   12/25/2007       0000-2400

Resource: IMS_STCTBL.IMS
    OFF THNXDARK03  11/27/2007-11/28 2000-3200
    ON  WEEKDAY     .MTWTF.          0800-1600
    OFF WEEKNIGHT   .MTWTF.          2400-3200
    OFF WENDDARK    S.....S          2000-3200
    OFF XMASDARK03  12/24/2007-12/25 2000-3200

  Resource: JES2_STCTBL.JES2
    ON  DEFAULT
    ON  THNXDARK03  11/27/2007-11/28 2000-3200
    ON  THNXLITE03  11/27/2007-11/28 0800-2000
    ON  WEEKDAY     .MTWTF.          0800-1600
    ON  WEEKEVENING .MTWTF.          1600-2400
    ON  WEEKNIGHT   .MTWTF.          2400-3200
    ON  WENDALL     S.....S          0000-2400
    ON  WENDDARK    S.....S          2000-3200
    ON  WENDLITE    S.....S          0800-2000
    ON  XMASDARK03  12/24/2007-12/25 2000-3200
    ON  XMASLITE03  12/24/2007-12/25 0800-2000

1Schedule: OPS44R>PRODUCTION ----------- LINKS ------------ 15 Apr 2007

                           * * * SORTED BY RESOURCE * * *

  Resource: TSO_STCTBL.TCAS
    ON  THNXDARK03  11/27/2007-11/28 2000-3200
    ON  THNXLITE03  11/27/2007-11/28 0800-2000
    ON  WEEKDAY     .MTWTF.          0800-1600
    ON  WEEKEVENING .MTWTF.          1600-2400
    ON  WEEKNIGHT   .MTWTF.          2400-3200
    ON  WENDDARK    S.....S          2000-3200
    ON  WENDLITE    S.....S          0800-2000
    ON  XMASDARK03  12/24/2007-12/25 2000-3200
    ON  XMASLITE03  12/24/2007-12/25 0800-2000

  Resource: TSO_STCTBL.TCASTEST
    OFF WEEKDAY     .MTWTF.          0800-1600
    OFF XMASALL03   12/25/2007       0000-2400

Syntax to have Schedule Manager perform a reset function:

RESET OI
    [SCHEDULE(ACTIVE)]

Request Schedule Manager to perform a RESET function resulting in the following:

The Schedule Manager RESET function is always executed using the ACTIVE schedule and the @OVERRIDE@ schedule, if one exists. The optional keyword SCHEDULE may be specified on the RESET_OI command to direct the request to another system. If the keyword SCHEDULE is specified, then the schedule name must be ACTIVE. If the keyword SCHEDULE is not specified, then the request is directed to the local system.

Example: Have Schedule Manager perform a RESET function

Command (and response) to have Schedule Manager perform a RESET function on the local system:

OI SM$API RESET_OI
SM$API MESSAGE: RESET SCHEDULED (continued...)
SM$API MESSAGE: Check OSF logs on system OPS44R.
SM$API Result=0
***

Syntax to synchronize a schedule:

SYNCH_AUTO
    {SCHEDULE(ssss)}

Synchronize schedule ssss with SSM table updates by automatically removing all links containing deleted SSM tables, resources, or both.

This command and the Y (synch) line command in Edit cannot be executed against the ACTIVE schedule. If the ACTIVE schedule becomes out-of-synch due to deleted SSM tables, resources or both, then the source schedule used to build the ACTIVE schedule will also be out-of-synch. You can use the SYNCH_AUTO command to synchronize the source schedule and then use the LOAD command to re-load it into the ACTIVE schedule.

Schedule Manager issues the following WTO during its RESET processing whenever it recognizes the ACTIVE schedule as being out-of-synch:

OPS7913E FATAL|Non-fatal SSM Schedule Manager error. ACTIVE schedule out-of-synch. Synch and re-load source schedule sssssssssss.

Schedule sssssssssss last loaded into the ACTIVE schedule is listed in the message text. It is most likely out-of-synch also. The error condition is not resolved until a synchronized schedule is loaded into the ACTIVE schedule.

If period definitions are missing, then this is a FATAL error and it will be indicated in the WTO text.

Notes:

Example: Synchronize schedule

Failing command (and response) to synchronize schedule PRODUCTION on the local system that contains links to deleted period definitions:

OI SM$API SYNCH_AUTO SCHEDULE(DAMAGED)
SM$API MESSAGE: MISSING PERIODS (continued...)
SM$API MESSAGE: Links to missing SSM tables/resources were deleted. Use OPSVIEW
                4.11.4 to SYNCH other links to missing period definitions.
SM$API Result=8
***

If SSM tables, resources, or both are missing, then this is a non-fatal error and it will be indicated in the WTO text. Schedule Manager RESET processing continues for remaining SSM resources after encountering a non-fatal error. In other words, Schedule Manager continues to schedule the desired states of your remaining SSM resources. A non-fatal error due to missing SSM tables, resources, or both can be resolved programmatically using the Schedule Manager API commands SYNCH_AUTO and LOAD, as described above. Of course, the user can also resolve the errors using the ISPF Schedule Manager application (OPSVIEW option 4.11.4).

Note: An AOF MSG rule could be written against the OPS7913E WTO to automate a programmatic resolution to a non-fatal Schedule Manager error due to an out-of-synch ACTIVE schedule.

Example: Remove all links to deleted SSM tables

Command (and response) to remove all links to deleted SSM tables, resources, or both from all periods defined in schedule PRODUCTION on the local system:

OI SM$API SYNCH_AUTO SCHEDULE(PRODUCTION)
SM$API MESSAGE: *SYNCHED
SM$API Result=0        
***

Syntax to delete a single link:

UNLINK
   {SCHEDULE(ssss)}
   {PERIOD(pppp)}
   {TABLE(tttt)}
   {RESOURCE(rrrr)}

Delete single link in schedule ssss between period pppp and resource rrrr in table tttt.

Example: Delete link

Command (and response) to delete the link in schedule PRODUCTION on the local system between period DEFAULT and resource ACF2 in table ACF2_STCTBL:

OI SM$API UNLINK SCHEDULE(PRODUCTION) PERIOD(DEFAULT)
               TABLE(ACF2_STCTBL) RESOURCE(ACF2)
SM$API Result=0
***