29.09.
2012

BPXBATCH

[◀ JCL Batch Jobs]

Contents

  1. Unpacking a zipped pax file
  2. Executing a shell script
  3. Test secure shell connection
  4. Secure FTP in batch

Unpacking a zipped pax file [▲ Top]

//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//PAX     EXEC PGM=BPXBATCH,
//             PARM='SH cd /path/; pax -rvf filename.pax.Z'
//STDOUT   DD  SYSOUT=*
//STDERR   DD  SYSOUT=*

Executing a shell script [▲ Top]

with standard input, output, error and enviroment DD-statement

//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//SHELL01 EXEC PGM=BPXBATCH,
//             PARM='SH /path/shell-script.sh'
//STDIN    DD  PATH='/STDIN-FILE-PATHNAME',
//             PATHOPTS=(ORDONLY)
//STDOUT   DD  PATH='~/mystd.out',
//             PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
//             PATHMODE=SIRWXU
//STDERR   DD  PATH='~/mystd.err',
//             PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
//             PATHMODE=SIRWXU
//*STDENV  DD  PATH='~/setting.envvars',
//*            PATHOPTS=ORDONLY
//STDENV   DD  *
TZ=EST5EDT
LANG=C
PATH=/bin:/usr/lpp/java/J6.0.1/bin
/*

Test secure shell connection [▲ Top]

//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//* *******************************************************************
//* CRYPTO-TEST: > ssh -vvv user@host
//* HARDWARE SUPPORT: 'DEBUG3: RNG IS READY, SKIPPING SEEDING'
//* SOFTWARE SUPPORT: 'DEBUG3: SEEDING PRNG FROM
//*                    /usr/lib/ssh/ssh-rand-helper'
//* *******************************************************************
//*
//SSHCONN EXEC PGM=BPXBATCH
//STDOUT   DD  SYSOUT=*,DCB=(RECFM=V,LRECL=256)
//STDERR   DD  SYSOUT=*,DCB=(RECFM=V,LRECL=256)
//STDPARM  DD  *
SH ssh -vvv user@host
/*
//STDENV   DD  *
TZ=EST5EDT
LANG=C
PATH=/bin:/usr/bin:/usr/sbin
/*

Secure FTP in batch [▲ Top]

sftp by using a command-batchfile

//*
//* +----1----+----2----+----3----+----4----+----5----+----6----+----7-
//*
//SFTP    EXEC PGM=BPXBATCH
//STDOUT   DD  SYSOUT=*,DCB=(RECFM=V,LRECL=256)
//STDERR   DD  SYSOUT=*,DCB=(RECFM=V,LRECL=256)
//STDENV   DD  *
PATH=/bin:/usr/bin:/usr/sbin
/*
//STDPARM  DD  *
SH echo "!cp \"//'MVS.DATASET'\" ~/copy.file \n"
        "put copy.file \n"
        "!rm ~/copy.file \n"
        "lcd /localpath \n"
        "cd /remotepath \n"
        "get other.file" > ~/sftp-batchfile;
   sftp -b ~/sftp-batchfile user@host:/path;
   rm ~/sftp-batchfile
/*

Kein Kommentar

Kommentieren

Dein Kommentar

*

Wir benutzen Cookies um die Nutzerfreundlichkeit der Webseite zu verbessen. Durch Deinen Besuch stimmst Du dem zu.