MicroStrategy ONE

Saving and loading a procedure

When you save a newly created procedure, it is saved as a plain text file with the filename <name>.cmp, where <name> is the name specified in the Name field.

The file is saved to the location specified in the General tab of the Options dialog box, in the Procedure File Directory field.  Procedures stored in this directory are shown in the list of sample procedures in the Choose Outline dialog box. The outlines and code samples for these procedures can then be easily included in users' scripts.

Command Manager procedure files contain additional metadata information that is not visible in the Procedure window but is required for the procedure to run. Do not simply copy and paste the text of the procedure into a text file in another editor.

You can open and edit a procedure after you have created it (from the File menu, select Open Procedure). You can also copy the procedure file to another location, such as a different computer, and open it on that computer. If you open a previously created procedure and then save it, your changes are saved in the same location you originally opened the procedure, and not necessarily to the specified Procedure File Directory.

Command Manager scripts can only use procedures that are stored in the user-specified directory. If your script calls a procedure that is saved elsewhere on your hard drive, Command Manager returns an error.

To set the default directory for user-created procedures

  1. From the Tools menu, select Options. The Options dialog box opens.

  2. Select the General tab.

  3. In the Procedure File Directory field, type the directory in which you want to store user-created procedures. Procedures stored in this directory are shown in the list of sample procedures in the Choose Outline dialog box.

  4. When you are finished making changes, click OK. The Options dialog box closes.

Related Topics

Procedures

Creating a procedure

Inserting sample statements: Outlines

Options dialog box: General tab