ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzaiq_5.4.0.1/rzaiqbatchftpsim.htm

102 lines
4.9 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="concept" />
<meta name="DC.Title" content="Simple example: Batch FTP" />
<meta name="DC.Relation" scheme="URI" content="rzaiqftpbatch.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2004, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2004, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzaiqbatchftpsim" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Simple example: Batch FTP</title>
</head>
<body id="rzaiqbatchftpsim"><a name="rzaiqbatchftpsim"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Simple example: Batch FTP</h1>
<div><p>This simple example shows a batch file transfer that involves the successful
transfer of one file from a remote system.</p>
<p>The components are as follows:</p>
<ul><li>A CL program</li>
<li>An input file of FTP commands</li>
<li>An output file of FTP messages</li>
</ul>
<p><strong>The CL program</strong></p>
<pre> ************************************************************
ITSOLIB1/QCLSRC BATCHFTP:
----------------------
PGM
OVRDBF FILE(INPUT) TOFILE(ITSOLIB1/QCLSRC) MBR(FTPCMDS)
OVRDBF FILE(OUTPUT) TOFILE(ITSOLIB1/QCLSRC) MBR(OUT)
FTP RMTSYS(SYSxxx)
ENDPGM
************************************************************ </pre>
<div class="note"><span class="notetitle">Note:</span> To make this sample work when written with ILECL, you must add OVRSCOPE(*CALLLVL)
to the OVRDBF commands.</div>
<p>The BATCHFTP program overrides the INPUT parameter to the source physical
file ITSOLIB1/QCLSRC MBR(FTPCMDS). The output is sent to MBR(OUT).</p>
<p><strong>The input commands file</strong></p>
<pre> ************************************************************
ITSOLIB1/QCLSRC FTPCMDS:
---------------------
ITSO ITSO
CD ITSOLIB1
SYSCMD CHGCURLIB ITSOLIB2
GET QCLSRC.BATCHFTP QCLSRC.BATCHFTP (REPLACE
QUIT
************************************************************ </pre>
<p>The FTP subcommands required are shown in the FTPCMDS file.</p>
<p><strong>The output messages file</strong></p>
<pre> ************************************************************
FTP Output Redirected to a File
FTP Input from Overridden File
Connecting to host name SYSxxx
at address x.xxx.xx.xxx using port 21.
220-QTCP at SYSxxx.sysnam123.ibm.com.
220 Connection will close if idle more than 5 minutes.
Enter login ID (itso):
&gt; ITSO ITSO
331 Enter password.
230 ITSO logged on.
i5/OS is the remote operating system. The TCP/IP version is "V3R1M0".
250 Now using naming format "0".
257 "QGPL" is current library.
Enter an FTP subcommand.
&gt; CD ITSOLIB1
Enter an FTP subcommand.
250 Current library changed to ITSOLIB1.
&gt; SYSCMD CHGCURLIB ITSOLIB2
Enter an FTP subcommand.
&gt; GET QCLSRC.BATCHFTP QCLSRC.BATCHFTP (REPLACE
200 PORT subcommand request successful.
150 Retrieving member BATCHFTP in file QCLSRC in library ITSOLIB1.
250 File transfer completed successfully.
147 bytes transferred in 0.487 seconds. Transfer rate 0.302 KB/sec.
Enter an FTP subcommand.
&gt; QUIT
221 QUIT subcommand received.
************************************************************ </pre>
<p>The output file is shown. It is a straightforward matter to write a program
to process this file and display an error message on QSYSOPR if there are
any error messages. FTP error messages have numbers that start with a 4 or
5.</p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzaiqftpbatch.htm" title="This topic provides examples of how to run File Transfer Protocol (FTP) in an unattended mode.">Run File Transfer Protocol in unattended mode using a batch job</a></div>
</div>
</div>
</body>
</html>