Update: participating in MTM 2020? Then you can skip this blogpost and use their instructions 🙂
Ever wondered how to connect Zowe CLI to the IBM Master the Mainframe contest’s mainframe? Or how to use VSCode with Master the Mainframe’s mainframe? This will be a thorough guide on how to install and setup everything Zowe related in order to connect to the MTM mainframe. Sorry for the long title, I need to make sure Google indexes this well, haha.
Heads up, if you mess up a lot during this process you will need to reset your password a lot of times. IBM’s tolerance on failed login attempts is very low which leads to a fast lock out. This is a good thing though! Click here to read how you can reset your password.
Installing Zowe CLI and its prerequisites
First all of we need to install Node.js, any version above 8 or the LTS version will do.
After installation, please verify that your Node.js is correctly installed by trying the following commands in your terminal or command prompt. Before doing this, close your existing terminals completely and re-open them. This will force them to reload the environment variables defined in your system.
Let’s ask IBM for access to Zowe
We need to talk to Zih. Who is Zih? He’s the guy you talk to when you have lost your password. Follow this guide to add Zih as a contact on Slack. Then you need to send him the following message:
Can you connect my id to zowe? Z50087
Be sure to change up your IBM ID. I have picked this off of YouTube, but I believe any sentence with Zowe and your ID in it will trigger the bot command. You could try ‘pls Zowe Z50087’.
Zowe CLI Package
After you have verified that your Node.js installation is correct, execute the following commands in your terminal.
npm install -g @zowe/[email protected] zowe plugins install @zowe/[email protected] zowe plugins install @zowe/[email protected] @zowe/[email protected] @zowe/[email protected] @zowe/[email protected] @zowe/[email protected]
The last command is optional, but I’m going for a complete installation.
Note, if you have an EACCESS error then you might need to give this a read. If you’re running a Linux distro then you might need to prepend sudo to your commands.
Configuring Zowe CLI
First of all we need to create a profile, we need to change up the following command:
zowe profiles create zosmf-profile myprofile123 --host host123 --port port123 --user ibmuser --password pass123 --ru false
After following the initial connectivity guide in the contest we can use those variables to create our profile. Be sure to use the latest connectivity guide as reference, I’m using the 2019 version. My command now looks like this:
zowe profiles create zosmf-profile mtm2019 --host 126.96.36.199 --port 10443 --user Z50087 --password pass123 --ru false
We can test our connection by executing a status check command. Don’t forget to change the profile name to yours.
zowe zosmf check status
Now I get to see the installed plug-ins. If the mtm2019 profile is not your default profile, then you’ll have to specify which profile you want to use in the command using –zosmf-profile ProfileName.
Delete a profile using the command zowe profiles delete zosmf profileName –force.
First install Visual Studio Code like you normally would install any other program. Yes, I am making my sentences longer than they need to be, this is a 1000 words assignment afterall. (JK).
Small note, I am using Visual Studio Code Portable from https://garethflowers.dev/vscode-portable/. This is so I can create custom VS Code instances for specific projects and langauges.
Look for the Zowe Explorer extension in the plug-in market. Install the extension.
Adding your connection to the plug-in
After installing the plug-in, a new menu item will appear. Click that menu item, then hover over data sets and you’ll see a plug sign. Click the plus sign and it will prompt you to create a new connection to z/OS.
- Profile name: mtm2019
- Host: https://188.8.131.52:10443
- Username: z50087 (your IBM id)
- Password: pass123 (your password)
- Reject unauthorized: false. It’s best you search for ‘false’ in the box to make sure you can’t select the wrong one.
After the connection is set, you will need to add the profiles to the different tabs.
Plug-in in action
In data sets I active my profile, in this case it’s zowemtm2019. Then I click on the loop to perform a search action. I’ll search for my own profile, z50087.
Observe the items highlighted in red. After my query I can see all my data sets and its members.
Yes yes, I bet you have noticed. I have messed up a million times creating the profiles, I literally have like a thousand profiles that don’t work because I barely knew what URL to enter. It also took me ages to notice my IBM z/OS was locked because of my failed login attempts haha. Ha. :'(
- View, rename, copy and filter mainframe data sets, USS files and jobs.
- Create download, edit, upload, and delete PDS and PDS members.
- Create Zowe CLI compatible zosmf profiles.
- Switch between Zowe CLI zosmf profiles to quickly target different mainframe systems.
- Submit jobs.
It also makes me feel young when using it.
First of all you might want some syntax highlighting.
- IBM Z Open Editor by IBM. For Enterprise COBOL, PL/I, and JCL.
- rexx-syntax-highlighting by Thomas Weber. For REXX ofcourse.
I finally did it, a Zowe post. Believe me, it was a hassle to make. I didn’t really find any clear guides on how to do it with the master the mainframe mainframe. Or maybe I missed it? Hmm…
Anyhow, how are you doing? Are you safe?
11 thoughts on “Tackle Master the Mainframe using Zowe CLI and VSCode”
Buenos dias, mi pregunta es si esto es lo que tengo que realizar en mi equipo para incorporarme al Open Mainframe Project, mi interes es por que requiero practicar cobol en mainframe
Thank you for this tutorial!
It really helps me a lot.
Hi I am trying the Master the Mainframe tasks and when I go to the UNIX side of it I keep getting the following error. Retrieving response from uss-file-list Error: The get request appeared to succeed, but the response was not in the expected format:
Unexpected token in JSON at position 2902. Anyone have a clue as to what that is.
Nice blogpost Kevin ! The Zowe Explorer is open source https://github.com/zowe/vscode-extension-for-zowe and it’d be great if you (and others) created git issues for things you’d like to see improved/added/fixed….
I am getting error : Profile Name mtm2020 is inactive. Please Check if your Zowe server is active or if the URL and port in your profile is correct.
I am using port number 10443, and there is no mistake in username or password.
I’m a bit late, but did you use the new “Host” url for this year’s machine? It’s probably different.
On opening the vscode and accessing the “add profile”. I got an error “command ‘zowe.addSession’ not found”.
any catch?? what to do now?
hey got that!! I have not updated to the latest version of vscode!! thanks.
thank you for this great tutorial!
I’m ok thank you for asking!
All good here. I agree 100% with you: to install instructions are absolutely a mess and confusing. I had the chance to follow the instructions indicated by Will/Bill Pereira!
I think Zowe is useless. No special new things.
Anyway very good install manual
I have looked up the names you mentioned, I believe you mean the videos? I’m not much of a video tutorial guy myself, most of the time I restrict myself to documentation only. For this one I had to acces 4-5 sites and fish out some information in Slack, not ideal.
The CLI is pretty much useless indeed, I feel much more comfortable editing things in a TN3270 emulator. Trying this out makes me wonder how they would even integrate this into the challenges, I’m glad they didn’t.