Published at 11/5/2024

Reserving a TCP Port on z/OS Without an IPL

Sometimes you need to reserve a port on IBM z/OS and have it ready right away without an IPL, such as when you are installing OpenSSH and need to test it immediately. This can be achieved through an obeyfile.

The first thing we need to do is make a dataset where you will be typing in the port(s) that the command will be reserving.

Your obeyfile should look something like this:

PORT
    22 TCP SSHD                ; SSH server

22 is the port that we are reserving in this case. SSHD is the started task for SSH, you can use asterisk such as SSH* instead if the started task has variable name.

semicolon starts a comment in our case it is "SSH server". Comments can be anything, though you should always specify what it is that you are reserving so others can figure out if it is still needed or important.

Now you can use the following command to reserve your port. Specify the dataset you created earlier. In your z/OS installation TCPPROC may have a different name. This is an operator command, there's multiple different ways of executing it outside of the operator console such as TSO CONSOLE or through Sysview if you have access to that tool.

VARY TCPIP,TCPPROC,CMD=OBEYFILE,DSN=<your.dataset.here>

If the string becomes too long for your terminal, you can type in an asterisk (*) instead of the dataset name and it will prompt you to type out the rest of the dataset, which is just your dataset.

VARY TCPIP,TCPPROC,CMD=OBEYFILE,DSN=*

I also highly recommend that besides simply reserving the port through this process that you also reserve it properly, once you have verified it works, because this obeyfile reservation is temporary and will disappear after an IPL.

Share on social media

Facebook share buttonReddit share buttonThreads share button