Earlier this month we published Beta2 for IBM SDK Node.js — z/OS beta based on Node.js v6.11.0. In this blog post we will walk you through a typical installation process for the beta, troubleshoot some common issues and run a “Hello World” program from the node prompt.

After downloading the beta from here we can unpack and run Node by issuing the following commands from USS.

pax -rf ibm-6.11.0.0-beta2-node-v6.11.0-os390-s390x.pax.Z -x pax
cd node-v6.11.0-os390-s390x
export PATH=`pwd`/bin:$PATH
./node

Unfortunately, instead of seeing the Node prompt we see it has been killed. This happens because Node v6.11.0 requires C++11 support and is dependent on the C++ compiler/runtime that has been shipped with the beta. We need to install the compiler by running the installer script unpack.pl and then set our STEPLIB to the newly installed C++ runtime. The compiler installation script dispatches a JCL job with a default MSGCLASS parameter of “S”. The script requires the MSGCLASS parameter to be set correctly so that the output of the JCL job is logged in the HELD OUTPUT QUEUE. Failure to set an appropriate MSGCLASS can result in XMIT errors. To specify a custom MSGCLASS parameter we need to set the COMPILER_INSTALL_MSGCLASS environment variable. The runtime dataset will be installed by default with the users ID as the high level qualifier. To change this default we can set COMPILER_INSTALL_HLQ environment variable.

Lets assume that we want to install the datasets under a HLQ “NODEUSR” and this users profile lists ‘H’ as the default MSGCLASS. Then we can proceed to install and run Node with the following set of commands.

pax -rf ibm-6.11.0.0-beta2-node-v6.11.0-os390-s390x.pax.Z -x pax
cd node-v6.11.0-os390-s390x
export COMPILER_INSTALL_HLQ=NODEUSR
export COMPILER_INSTALL_MSGCLASS=H
./unpack.pl
export PATH=`pwd`/bin:$PATH
export STEPLIB=NODEUSR.CEEZ230.D170510.RT22.SCEERUN2:$STEPLIB
./node
>console.log("Hello World")

If installation completes successfully we should see a “Hello World” pop up on our screen. If an error occurs during installation it is typically because the MSGCLASS parameter is not set correctly. We can query the MSGCLASS parameter on TSO with the following command

LISTUSER NODEUSR TSO NORACF

If the user ID does not have the appropriate permission to view this information then get in touch with the system administrator . We hope you find this short tutorial helpful and as always if you have any issues please get in touch with us via our Community or Github.

Join The Discussion

Your email address will not be published. Required fields are marked *