SSH

Tectia sftpg3

Submitting a Job

The following examples show how to submit a job for execution and receive a notification of the ID assigned to the submitted job. In the examples it is assumed that the JCL script br14.jcl with the following contents is stored in the directory /home/user1/src/jcl/ on a Unix host:

//USERJ0  JOB ,,CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
//            NOTIFY=&SYSUID
//*
//STEP00  EXEC PGM=IEFBR14
//

Example 1. Interface with JES using a file transfer advice string:

$ sftpg3 user1@mf_server 1 
sftp> sput /home/user1/src/jcl/br14.jcl /ftadv:filetype=jes,c=ISO8859-1,d=IBM-1047/ 2
br14.jcl                           |   100B |      29B/s | TOC: 00:00:03 | 100%        
07.57.19 JOB03198  $HASP100 USERJ0   ON INTRDR              FROM STC03197 USER17      
07.57.20 JOB03198  IRR010I  USERID USER1   IS ASSIGNED TO THIS JOB.
JOBID=JOB03198 3
1

Open an SFTP session from your client to the target server (in this example mf_server).

2

Submit the job (/home/user1/src/jcl/br14.jcl) using sput. Use a file transfer advice string to set file type to JES and to specify code set conversion. In this example the code set is ISO8859-1 during the transfer and the server should store the data set with the IBM-1047 code set.

3

At the end of the output you can see the job ID (JOB03198) that was assigned to the job.

Example 2. Interface with JES using the site command:

$ sftpg3 user1@mf_server 1
sftp> ascii 2
File transfer mode is now ascii.
sftp> site filetype=JES 3
sftp> sput /home/user1/src/jcl/br14.jcl 4
br14.jcl                           |   100B |      33B/s | TOC: 00:00:02 | 100%
06.54.20 JOB03384  $HASP100 USERJ0   ON INTRDR              FROM STC03354 USER16
06.54.21 JOB03384  IRR010I  USERID USER1   IS ASSIGNED TO THIS JOB.
JOBID=JOB03384 5
1

Open an SFTP session from your client to the target server (in this example mf_server).

2

Set the file transfer mode to ASCII.

3

Run site to set file type to JES.

4

Submit the job using sput.

5

At the end of the output you can see the job ID (JOB03384).

Retrieving the Spool Output of a Job

To retrieve the spool output of a submitted job, run the get command with the job's ID.

Example 1. Interface with JES using a file transfer advice string to specify the file type and code set conversion:

sftp> get /ftadv:filetype=JES,C=ISO8859-1,D=IBM-1047/JOB03198
JOB03198                           |  1.1kB |     431B/s | TOC: 00:00:02 | 100%

Example 2. Interface with JES using the site command:

sftp> ascii 1
File transfer mode is now ascii.
sftp> site filetype=JES 2
sftp> get JOB03384 3
JOB03384                           |  2.2kB |     831B/s | TOC: 00:00:02 | 100%
sftp> site filetype=SEQ 4
1

Set file transfer mode to ASCII.

2

Run the site command to change file type to JES.

3

Retrieve the job.

4

Return to accessing the normal file system.

Deleting Jobs

To delete a job (in this example JOB03198), use the rm command and an advice string to set file type to JES:

sftp> rm /ftadv:filetype=JES/JOB03198

Listing Jobs

Example 1. To display the status of all the jobs that are on the JES spool for your user ID, enter the following command:

sftp> ls /ftadv:filetype=JES/

Example 2. To list jobs in the long name format, enter:

sftp> ls -l /ftadv:filetype=JES/

Example 3. To list the contents of a specific job (in this example JOB03419) in the long name format:

sftp> ls -l /ftadv:filetype=JES/JOB03419/ 1
/FTADV:filetype=JES//u/home/user1/JOB03419/:
Volume Referred    Recfm Lrecl BlkSz Dsorg    Space  Dsname
JOB03419 USER1   USERJ0   A        J      0000
  0002          JES2     JESMSGLG    18       1048 UA       133
  0003          JES2     JESJCL       6        299 V        136
  0004          JES2     JESYSMSG     9        559 VA       137
1

Note the required trailing slash after the job ID.