# File Master Plus Plug-in for Zowe CLI

The File Master Plus Plug-in for Zowe CLI enables you to quickly create, edit, and manage VSAM, sequential, and partitioned data sets.

## Table of content

- [Installation](#installation)
  - [Prerequisites](#prerequisites)
  - [Install the File Master Plus Plug-in for Zowe CLI](#install-the-file-master-plus-plug-in-for-zowe-cli)
  - [Validate the Installation](#validate-the-installation)
  - [Create a File Master Plus User Profile](#create-a-file-master-plus-user-profile)
- [Sample Use Cases](#sample-use-cases)
- [Uninstall the File Master Plus Plug-in for Zowe CLI](#uninstall-the-file-master-plus-plug-in-for-zowe-cli)

## Installation

You can install the File Master Plus plug-in for Zowe CLI from the Zowe Package.

### Prerequisites

Before you install and use the File Master Plus plug-in, complete the following tasks:

1. Zowe CLI is installed on your computer. For more information, see [Installing Zowe CLI](https://docs.zowe.org/stable/user-guide/cli-installcli).
2. File Master Plus version 12 or later is installed and running in your mainframe environment.
3. File Master Plus REST API server is installed, configured, and running.
3. (Optional) The File Master Plus REST API is integrated with the API Mediation Layer (API ML).

For more information, see the  [File Master Plus documentation](https://techdocs.broadcom.com/fmp).

### Install the File Master Plus Plug-in for Zowe CLI

To install the File Master Plus plug-in, use the online registry. For more information, see [Installing Zowe CLI plug-ins](https://docs.zowe.org/stable/user-guide/cli-installplugins).

The File Master Plus plug-in for Zowe CLI is associated with the following tags:

* @latest
* @zowe-v2-lts
* @zowe-v3-lts

The @zowe-v2-lts and @zowe-v3-lts tags indicate stable plugin versions compatible with the Zowe V2 LTS and Zowe V3 LTS respectively.

The @zowe-v1-lts version is now deprecated and should be upgraded to the V2 or V3 LTS.

The @latest tag is actively updated with new features and functionality.

To install the actively updated version of the File Master Plus plug-in, issue the following command:
```
zowe plugins install @broadcom/file-master-plus-for-zowe-cli@latest
```
To install the V3 stable version of the File Master Plus plug-in, issue the following command:
```
zowe plugins install @broadcom/file-master-plus-for-zowe-cli@zowe-v3-lts
```
To install the V2 stable version of the File Master Plus plug-in, issue the following command:
```
zowe plugins install @broadcom/file-master-plus-for-zowe-cli@zowe-v2-lts
```

### Validate the Installation

To validate the installation, issue the following command:
```
$ zowe plugins validate @broadcom/file-master-plus-for-zowe-cli
```
Successful validation of the File Master Plus plug-in returns the "This plugin was successfully validated. Enjoy the plugin" response.

If an error message is displayed, troubleshoot the installation by addressing the issues described in the message. You can also review the log file located in the Zowe CLI home directory for more information.

### Create a File Master Plus User Profile

Create a File Master Plus user profile to avoid entering your connection details each time that you issue a command. You can create multiple profiles and switch between them as needed.

Issue various `zowe config` commands, such as `init`, `auto-init`, and `convert-profiles` to create a `zowe.config.json` configuration file. If the File Master Plus plug-in is installed when you issue one of these commands, a profile for a File Master Plus profile is automatically added to your `zowe.config.json` configuration file.
 
Alternatively, create a File Master Plus user profile manually by adding a section that contains the configuration details to your `zowe.config.json` configuration file:

1. Navigate to the directory: `C:\Users\<username>\.zowe`.
2. Open the `zowe.config.json` configuration file using a text editor or IDE.  
  **Note**: If the file does not exist, issue the following command to create the configuration file: `zowe config init --gc`
3. Add the following JSON to the `"profiles"` section of the configuration file:  
  ```
  "fmp_profile": {  
      "type": "fmp",  
      "properties": {  
          "host": "example.com",  
          "port": 12345,  
          "protocol": "http",  
          "user": "johndoe",  
          "password": "qwerty",  
          "rejectUnauthorized": false  
          },  
      },
   ```
4. Populate the following fields in the above JSON:
    - **host** (string)  
    The host URL of your Testing Tools server instance
    - **port** (integer)  
    The port number of your Testing Tools server instance  
    **Default**: 51914
    - **protocol** (string)  
    Specify "https" or "http".  
    **Default**: https
    - **user** (string)  
    Your mainframe username
    - **password** (string)  
    Your mainframe password
    - **rejectUnauthorized** (boolean)  
    Specify "false" to accept self-signed certificates.  
    **Default**: true
5. Save the file.

The File Master Plus user profile is created. 

## Sample Use Cases:

As an application developer, you can use the File Master Plus plug-in to perform the following tasks:

* CREATE  
Allocates a VSAM data set along with its components, by copying the parameters of an existing VSAM file.

* POPULATE  
Populates a VSAM data set with newly constructed test data stored in a JSON file.

* COPY  
Copies a whole VSAM data set using a single CLI command.  It selects the required parts from the source data set and copies them to a new VSAM data set.

* RENAME  
Renames a VSAM data set.

* DELETE  
Deletes a VSAM data set.

## Uninstall the the File Master Plus Plug-in for Zowe CLI

To uninstall the File Master Plus  plug-in, issue the following command:
```
zowe plugins uninstall @broadcom/file-master-plus-for-zowe-cli
```
