Your browser does not allow storing cookies. We recommend enabling them.

SSH

Fetching a remote file into an MVS data set

This example (SCPGET from SAMPLIB) executes scpg3 and copies a remote file (file.bin) into a data set (//'USER.TEST.BINFILE'). If the data set does not exist, it is created with default values recfm VB and lrecl 1024.

The stdout and stderr message files are printed to SYSOUT. Required environment variables are supplied in SSHENV via STDENV DD. Modify the DD statement according to your requirements.

//SCPGET  EXEC PGM=BPXBATSL,REGION=0M
//STDPARM  DD  *
PGM /opt/tectia/bin/scpg3
  user@remote:file.bin
  //'USER.TEST.BINFILE'
//STDENV   DD  DSN=SSZ.SRVR6410.PARMLIB(SSHENV),DISP=SHR
//STDOUT   DD  SYSOUT=*
//STDERR   DD  SYSOUT=*
//STDIN    DD  DUMMY
//

The same file transfer can be carried out using sftpg3 in batch mode (-B option):

//SFTPGET  EXEC PGM=BPXBATSL,REGION=0M
//STDPARM  DD  *
PGM /opt/tectia/bin/sftpg3 -B //DD:STDIN
  user@remote
//STDENV   DD  DSN=SSZ.SRVR6410.PARMLIB(SSHENV),DISP=SHR
//STDOUT   DD  SYSOUT=*
//STDERR   DD  SYSOUT=*
//STDIN    DD  *
sget file.bin //'USER.TEST.BINFILE'
//



Want to see how PrivX can help your organisation?

Are you a DEVELOPER accessing cloud hosts, are you a IT ADMIN managing access & credentials in your corporation, are you BUSINESS MANAGER and want to save money or are you responsible of IT SECURITY in DevOps