Submitting DFSMShsm commands using JCL and FTP

You can submit DFSMShsm commands by sending JCL files through ftp to z/OS® and have output data sets sent back to your Linux system. You must have TCP/IP and ftp running and a userid and password authorized to use ftp. Once you log into the z/OS ftp server you must enter the following command.
site filetype=jes
//LNXDUMP JOB ,CLASS=A,USER=IBMUSER,PASSWORD=IBM,
 // MSGCLASS=H,REGION=4096K,MSGLEVEL=(1,1)
 //LISTDUMP EXEC PGM=IKJEFT01
 //SYSTSPRT DD SYSOUT=A
 //SYSTSIN  DD *
 HSEND LIST DUMPVOLUME ODS(LIST.DUMP.VOLUMES)
 //FTPDUMP  EXEC PGM=FTP,COND=(0,NE,LISTDUMP),
 //          PARM='1.2.3.4'
 //SYSPRINT DD SYSOUT=*
 //OUTPUT   DD SYSOUT=*
 //SAVE     DD *
 /*
 //INPUT    DD *
 userid
 password
 ascii
 put 'LIST.DUMP.VOLUMES' dump.list
 quit
 /*

The IKJEFT01 program in the above JCL allows you to submit TSO line commands. The HSEND command allows DFSMShsm commands to be submitted from TSO. After HSEND you can use any DFSMShsm command. In the second step, the data set LIST.DUMP.VOLUMES is sent through ftp to IP address 1.2.3.4 and given a file name of dump.list.