Zowe Explorer Extension for FTP

Na Tian
Zowe
Published in
6 min readJun 3, 2021

{Core} The Open Mainframe Project’s Zowe Explorer provides a Visual Studio Code extension for mainframe developers that includes three new views: z/OS data sets, USS directories, and JES jobs. From these a user can create, view, edit, delete and perform other actions directly against z/OS data and services. Underpinning the function is the Zowe Node SDK which is also shared with the Zowe Command Line Interface (CLI).

The core Zowe CLI uses z/OSMF REST APIs for its backend z/OS service and makes client server calls within the SDK. One of the nice things in the architecture of Zowe Explorer is that it has an interface abstraction layer that allows alternative back ends to serve data. An example of where this can be used is for customers who do not wish to use z/OSMF as their API backend for Zowe, and are comfortable using z/OS file transfer protocol (FTP) instead. For example, users who just want to do a lot of dataset, uss file and JOB related operations, may not need take much time on configuration z/OSMF.

The Zowe Explorer Extension for FTP is an extended feature which adds the FTP protocol to the Zowe Explorer VS Code extension. This allows you to use z/OS FTP Plug-in for Zowe CLI profiles to connect and interact with z/OS data sets, USS files, and jobs.

It is very easy to install and configure. Try it with me!

Prerequisites

Host-side prerequisites:

1. Enable FTP or FTPS (FTP over SSL) services on z/OS. The secure FTPS is recommended because FTPS can not only achive business requirements but also security standards . You can enable the FTP service by referring to the following link: https://www.ibm.com/docs/en/zos/2.4.0?topic=applications-transferring-files-using-ftp.

2. Ensure the value of the FTP setting JESINTERFACELEVEL is 2.

To check the value of JESINTERFACELEVEL, you can run command status from ftp localhost on USS environment.

The following is the sample output for the command status:

Command:

status

>>> STAT

............

211-JESLRECL is 80

211-JESRECFM is Fixed

211-JESINTERFACELEVEL is 2

211-Server site variable JESTRAILINGBLANKS is set to TRUE

............

211-Server site variable LISTLEVEL is set to 0

211 *** end of status ***

Command:

Installation

Search for the keyword ‘zowe’ in VS Code marketplace. You will find Zowe Explorer and Zowe Explorer Extension for FTP. See the picture below:

Then click the Install buttons to install Zowe Explorer and Zowe Explorer Extension for FTP. After you installed them, there is an icon like

in the left side bar. It indicates you successfully installed them. Let’s create a FTP profile to connect to z/OS now!

Create FTP user profile

Click the Zowe icon.

You will see three views: DATA SETS, UNIX SYSTEM SERVICES(USS) and JOBS.

Move your mouse to the plus icon in DATA SETS to add a profile.

You need to fill in the following contents to create a new connection to z/OS.

Connection name: Give a name of the connection profile.

Profile type: Choose zftp profile.

z/OS URL: Specify the z/OS host domain name or IP address.

Port number: The port number of z/OS FTP server.

Username: The userid for z/OS.

Password: The password for the userid.

Encryption: Set to True if FTPS is used.

Self-signed certificates: Select whether to reject connections with self-signed certificates,

Server name for the SNI TLS extension: Leave this blank if you don’t use it.

Time: The time to wait for the connection to be established.

When the profile created successfully you will receive message ‘Profile profilename was created’.

You can also add the created profile to UNIX SYSTEM SERVICES(USS) and JOBS by clicking the plus icons for those views.

Now you are ready to interact with z/OS datasets, USS files and jobs.

What can you do?

There are a lot of things you can do through the extension using FTP. The following picture show the functions it supports.

Try it in a scenario

Most of the functions in this extension can be explored easily. Below, we’ll walk through the main functionality in a common scenario. Let’s see the scenario first.

Scenario:

Jack (system Z user) wants to run a USS script by submitting a job, and then view the output when the job has finished. This can be broken down into several smaller tasks:

- Create USS file named demo.sh and write a simple script.

- Create the dataset member named USSCMD to run demo.sh.

- Submit the job.

- Check the job log.

Now let’s do it step by step.

Create USS file named demo.sh and write a simple script:

- Go to the directory /u/tnzsys/demo and list the files and subdirectories. (replace tnzsys with your username)

- Right click the profile in UNIX SYSTEM SERVICES(USS) and click the Create File.

- Input the location and file name to create. Press ‘Enter’ to confirm the inputs.

- Now the file demo.sh has been created successfully.

- Click demo.sh to open the file in edit mode. Write the simple script and save it.

The simple script:

echo “hello zftp”

Create the dataset member named USSCMD to run demo.sh:

- Specify the member name and press ‘ENTER’.

- Open the member USSCMD and write the JCL.

- When you finished the JCL, save it, and the member will be uploaded to the mainframe.

Tip: If the content in your saved dataset member conflicts with the member on the mainframe, a conflict message will appear:

To resolve the conflict, you just need pull the latest content from mainframe. Then update the member and save it again. But please notice that pulling the latest content from the mainframe will overwrite any changes you made locally. So you should copy your local content first, then pull from the mainframe, and then paste your updated parts.

Submit the job:

- Right click the member and select Submit Job. The job will be submitted and return a JOBID.

Check the job log:

- Click the JOBID in the message. It will lead to the JOBS view.

- Expand the job to list the spool files.

- Now Jack can view any of the output he wants by clicking on it. For example, view the JESMSGLG to see the return code.

Now Jack finished his simple work by using Zowe Explorer FTP Extension.

It is easy, right? Try it now!

Bonus - Add to Favorites

There is a very useful function: Add to Favorites. You can add your frequently used datasets, members, USS directories, USS files, and jobs to the Favorites by click the star icon or the option ‘Add to Favorites’.

The following example shows the dataset TNZSYS.DEMO.TEST was added to the DATA SETS Favorites, USS file demo.sh was added to the UNIX SYSTEM SERVICES(USS) Favorites and job JOB29240 are added to the JOBS Favorites.

Learn more:

If you enjoyed this blog checkout more Zowe blogs here. Or, ask a question and join the conversation on the Open Mainframe Project Slack Channel #Zowe-dev, #Zowe-user or #Zowe-onboarding. If this is your first time using the OMP slack channel register here.

Zowe is owned and managed by the Open Mainframe Project which is a Linux Foundation project.

Reference:

https://github.com/zowe/vscode-extension-for-zowe/tree/master/packages/zowe-explorer-ftp-extension

https://github.com/zowe/zowe-cli-ftp-plugin#install-the-zos-ftp-plug-in

https://docs.zowe.org/stable/user-guide/cli-installcli.html

--

--