SSH Tectia 
PreviousNextUp[Contents] [Index]

    About This Document >>
    Installing SSH Tectia Server for IBM z/OS >>
    Getting Started with SSH Tectia Server for IBM z/OS >>
    Setting up Non-Interactive Server and User Authentication >>
    Setting up Non-Interactive Secure File Transfer >>
        File Transfer Profiles >>
        File Transfer Examples>>
            File Transfer Example Using scp2
            File Transfers Using REXX Scripts and a JCL Procedure

File Transfer Example Using scp2

This example uses the SCP2GET JCL that can be found from SAMPLIB. SAMPLIB contains also other scp2 and sftp2 non-interactive file transfer examples.

This example executes scp2 using public-key authentication and copies a remote file textfile.txt into a dataset //'USERID.TEST.TEXTFILE'. If the dataset does not exist, it is created with default values recfm VB and lrecl 1024.

//SCP2GET EXEC PGM=IKJEFT1A,
//             DYNAMNBR=75,
//             TIME=1440,
//             REGION=6M
//SYSPRINT DD  SYSOUT=*
//SYSTSPRT DD  SYSOUT=*
//SYSTERM  DD  DUMMY
//STDOUT   DD  PATH='/tmp/&SYSUID.-SCP2GET.out',
//             PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
//             PATHMODE=(SIRUSR,SIWUSR)
//STDERR   DD  PATH='/tmp/&SYSUID.-SCP2GET.err',
//             PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
//             PATHMODE=(SIRUSR,SIWUSR)
//STDENV   DD  DSN=&SYSUID..SSZ.SRVR550.PARMLIB(SSHENV),
//             DISP=SHR
//SYSTSIN  DD  *
  BPXBATCH PGM /usr/lpp/ssh2/bin/scp2 +
        -oallowedauthentications=publickey +
        user1@remote_host:textfile.txt +
        //'USERID.TEST.TEXTFILE'
/*
//STDPR   EXEC PGM=IKJEFT1A,
//             DYNAMNBR=75,
//             TIME=1440,
//             REGION=6M
//SYSPRINT DD  SYSOUT=*
//SYSTSPRT DD  SYSOUT=*
//SYSTERM  DD  DUMMY
//STDOUT   DD  PATH='/tmp/&SYSUID.-SCP2GET.out',
//             PATHOPTS=(ORDONLY),
//             PATHDISP=(DELETE,KEEP)
//STDERR   DD  PATH='/tmp/&SYSUID.-SCP2GET.err',
//             PATHOPTS=(ORDONLY),
//             PATHDISP=(DELETE,KEEP)
//STDOUTPR DD  SYSOUT=*,
//             DCB=(LRECL=4000,RECFM=VB)
//STDERRPR DD  SYSOUT=*,
//             DCB=(LRECL=4000,RECFM=VB)
//SYSTSIN  DD  *
  OCOPY INDD(STDOUT) OUTDD(STDOUTPR) TEXT
  OCOPY INDD(STDERR) OUTDD(STDERRPR) TEXT
/*

PreviousNextUp[Contents] [Index]


[ Contact Information | Support | Feedback | SSH Home Page | SSH Products ]

Copyright © 2007 SSH Communications Security Corp.
This software is protected by international copyright laws. All rights reserved.
Copyright Notice