Submit or Retrieve Jobs with FTP / Alternative For Remote Job entry (RJE)

This post is about an alternative for remote job entry, you can use the TCP/IP FTP service in zOS and a Shell/command prompt to retrieve, List, and submit Jobs to Mainframe.

Basic Commands used in this article

FTP                   – To start FTP
Open remore_system_ip – To connect to host via FTP
QUOTE site filetype=JES     – Connect to JESPLEX, (conect to JES in layman terms)
DIR                   – List Jobs
Get filename          – Get Job dataset from remote system
PUT filename          – Submit Job

Make Sure that the FTP is up and running in your mainframe system.

You can do this by find the “TCPIP” job in your spool.

Connect to Mainframe via FTP

Open the command prompt/Shell and Enter FTP.
Enter Open your mainframe_host_ip
Enter your user ID followed by password

C:\>ftp
ftp> open demomvs.demopkg.ibm.com

Connected to demomvs.demopkg.ibm.com.
220-FTPD1 IBM FTP CS V1R13 at demomvs.demopkg.IBM.COM, 05:53:23 on 2012-11-30.
220 Connection will close if idle for more than 5 minutes.
User (demomvs.demopkg.ibm.com:(none)): dds1764
331 Send password please.
Password:
230 DDS1764 is logged on.  Working directory is “DDS1764.”.
ftp>

At this point you are connected to MVS subsystem,  if you issue a DIR you can see your MVS datasets, issue SITE FILETYPE=JES to get connected to JESPLEX

ftp> quote site filetype=jes
200 SITE command was accepted

Issue a DIR command to see the jobs.

Unlike SDSF, the dir command display the last ran job, first in the list

ftp> dir
200 Port request OK.
125 List started OK for JESJOBNAME=DDS1764*, JESSTATUS=ALL and JESOWNER=DDS
JOBNAME  JOBID    OWNER    STATUS CLASS
DDS1764J JOB01982 DDS1764  OUTPUT A        RC=0000 6 spool files
DDS1764J JOB01683 DDS1764  OUTPUT A        RC=0000 6 spool files
DDS1764J JOB01682 DDS1764  OUTPUT A        RC=0016 6 spool files
DDS1764J JOB01681 DDS1764  OUTPUT A        RC=0016 6 spool files
DDS1764J JOB01680 DDS1764  OUTPUT A        RC=0016 6 spool files
DDS1764J JOB01678 DDS1764  OUTPUT A        RC=0016 6 spool files
DDS1764J JOB01676 DDS1764  OUTPUT A        RC=0016 6 spool files
DDS1764J JOB01675 DDS1764  OUTPUT A        RC=0016 6 spool files
DDS1764J JOB01673 DDS1764  OUTPUT A        RC=0016 4 spool files
DDS1764J JOB01672 DDS1764  OUTPUT A        RC=0016 4 spool files
DDS1764J JOB01667 DDS1764  OUTPUT A        RC=0016 5 spool files
DDS1764J JOB01665 DDS1764  OUTPUT A        RC=0012 4 spool files
DDS1764J JOB01662 DDS1764  OUTPUT A        (JCL error) 3 spool files
DDS1764C JOB00417 DDS1764  OUTPUT A        RC=0000 6 spool files
DDS17641 JOB00414 DDS1764  OUTPUT A        RC=0012 4 spool files
DDS1764E JOB05786 DDS1764  OUTPUT A        RC=0000 4 spool files
DDS17641 JOB04559 DDS1764  OUTPUT A        RC=0000 5 spool files
DDS17641 JOB04557 DDS1764  OUTPUT A        RC=0012 4 spool files
DDS17641 JOB04555 DDS1764  OUTPUT A        RC=0012 4 spool files
DDS17641 JOB04498 DDS1764  OUTPUT A        RC=0012 4 spool files
DDS1764  TSU01992 DDS1764  ACTIVE TSU
250 List completed successfully.
ftp: 1430 bytes received in 0.70Seconds 2.03Kbytes/sec.
ftp>

Issue DIR JOBID to see the files associated with the JOB

ftp> dir JOB01982
200 Port request OK.
125 List started OK for JESJOBNAME=DDS1764*, JESSTATUS=ALL and JESOWNER=DDS1764
JOBNAME  JOBID    OWNER    STATUS CLASS
DDS1764J JOB01982 DDS1764  OUTPUT A        RC=0000
——–
         ID  STEPNAME PROCSTEP C DDNAME   BYTE-COUNT
         001 JES2              A JESMSGLG      1137
         002 JES2              A JESJCL         425
         003 JES2              A JESYSMSG      4303
         004 STP010            A SYSOUT        2645
         005 STP010            A JNF1JMSG      2746
         006 STP010            A JNF2JMSG      2746
6 spool files
250 List completed successfully.
ftp: 500 bytes received in 0.00Seconds 166.67Kbytes/sec.

Issue GET JOBID.n “destination_file” to ftp the job files from Mainframe to your machine. If you issue GET JOBID.n (n is a number) you will get the nth file from JOB, if it is GET JOBID.X you will get all the files belongs to that JOB

ftp> get JOB01982.x “C:\temp1\JOB01982.x.txt”
200 Port request OK.
125 Sending all spool files for requested Jobid
250 Transfer completed successfully.
ftp: 22154 bytes received in 1.53Seconds 14.47Kbytes/sec.
ftp> get JOB01982.1 “C:\temp1\JOB01982.1.txt”
200 Port request OK.
125 Sending data set DDS1764.DDS1764J.JOB01982.D0000002.JESMSGLG
250 Transfer completed successfully.
ftp: 1312 bytes received in 0.00Seconds 1312.00Kbytes/sec.
ftp>

Issue PUT “JCLL_location”  (JCLL_location is the JCL file path in your local machine). Eg. in my Machine the JCL is located at “C:\temp1\sort_jcl.txt”

ftp> put “C:\temp1\sort_jcl.txt”
200 Port request OK.
125 Sending Job to JES internal reader FIXrecfm 80
250-It is known to JES as JOB02315
250 Transfer completed successfully.
ftp: 754 bytes sent in 0.37Seconds 2.02Kbytes/sec.
ftp>

Issue DIR to see the latest JOB

250 Transfer completed successfully.
ftp: 754 bytes sent in 0.37Seconds 2.02Kbytes/sec.
ftp> dir
200 Port request OK.
125 List started OK for JESJOBNAME=DDS1764*, JESSTATUS=ALL and JESOWNER=DDS1764
JOBNAME  JOBID    OWNER    STATUS CLASS
DDS1764J JOB02315 DDS1764  OUTPUT A        RC=0000 6 spool files
DDS1764J JOB01982 DDS1764  OUTPUT A        RC=0000 6 spool files
DDS1764J JOB01683 DDS1764  OUTPUT A        RC=0000 6 spool files
DDS1764J JOB01682 DDS1764  OUTPUT A        RC=0016 6 spool files
DDS1764J JOB01681 DDS1764  OUTPUT A        RC=0016 6 spool files

 

Guys try this yourself, if this post helped you, don’t forget to Comment/like/share the page and of course visit the below advertisement.

Cheers- Shibu Thannikkunnath

6 thoughts on “Submit or Retrieve Jobs with FTP / Alternative For Remote Job entry (RJE)

  1. Hi Shibu,

    Great post. Learned alot from this. Actually I was trying to automate some mainframe task, in which I am trying submit the job from ftp command prompt. I am successfull in doing that.

    But I am not able to check the status of that job. And your post was really usefull regarding this.

    May be you can help now, I tried the command ‘dir’ and ‘dir JOB42902’ but its not showing any output. Its showing msg ‘No Jobs found on held queue’.

    Below is my command prompt messages:
    Password:
    230 SIDSKO is logged on. Working directory is “SIDSKO.”.
    ftp> QUOTE SITE FILETYPE=JES
    200 SITE command was accepted
    ftp> put “C:Documents and SettingsC0224264DesktopVBScriptsRENEWERR_JCL_SUB.
    txt”
    200 Port request OK.
    125 Sending Job to JES internal reader FIXrecfm 80
    250-It is known to JES as JOB43908
    250 Transfer completed successfully.
    ftp: 3292 bytes sent in 0.00Seconds 3292000.00Kbytes/sec.
    ftp> dir
    200 Port request OK.
    125 List started OK
    No jobs found on Held queue
    250 List completed successfully.
    ftp: 29 bytes received in 0.00Seconds 29000.00Kbytes/sec.
    ftp> dir JOB43908
    200 Port request OK.
    125 List started OK
    No jobs found on Held queue
    250 List completed successfully.
    ftp: 29 bytes received in 0.00Seconds 29000.00Kbytes/sec.
    ftp>

    Could you please help why dir is not working in my system.

  2. I tried the above procedure, but my job goes in a loop and not completing Execution, where as, when I manually submit it all right. Please help me with this. I have to go in SDSF and purge it finally.

  3. Hi,
    i gave dir jobid
    but, it keepon gave only the spool initial display .

    I cannot go to the job

    Could you pl.help me ?

  4. For the jobs not getting displayed, it could be due to the name of job. There is setting in of JESINTERFACELEVEL=1, then the job name in the JCL must be USERIDx, where x is a 1-character letter or number. So this means the job name should be your TSO user id and a then alphabet prefixed to it.
    For eg. if TSO id is ABC111, then job name could be ABC111Y

Leave a Reply

Your email address will not be published. Required fields are marked *

9 − three =