GUIDELINE
1.0 SUBJECT: TC Paccess - FTP Services
2.0 DISTRIBUTION: All Current Users
3.0 FROM: Donald C. Heiman, Acting Director of DISC
4.0 PURPOSE: This guideline provides user instructions on how to use the ftp services offered by the MVS TCPaccess product.
5.0 BACKGROUND: FTP (File Transfer Protocol) is a standard TCP/IP protocol that describes how data may be transferred between computer systems. As long as the ftp rules are followed, described by several Internet Request for Comments (RFCs), data may be transferred across dissimilar computer platforms. Request for Comments set standards for the Internet protocols.
Interlink has provided two types of ftp services through its TCPaccess product. One service, client ftp, allows users that are connected to the DISC MVS host to ftp to other hosts. Client ftp is available as a TSO command processor or as a batch program. Server ftp provides file transfer facilities for those users who are connected to the MVS host via TCP/IP.
6.0 PROCEDURE: This discussion will provide basic instructions on how to use both client and server ftp described above. This set of procedures will provide a minimum of information necessary to utilize the file transfer facilities. Some familiarity with ftp by the user is assumed, but enough information has been provided to allow a novice to successfully transfer data with these instructions. A more detailed set of instructions, that includes many of the more esoteric options of the MVS TCP/IP ftp software, is stored in a read-only dataset on the MVS host. Information regarding the contents of this dataset may be found in the member $README.
6.1 GENERAL INFORMATION
6.1.1 SECURITY INFORMATION: A Top Secret facility, SNSTCP, must be added to a Top Secret signon to permit the use of FTP. Your agency Top Secret administrator will control this profile. SNSTCP also uses Top Secret to verify the user's access to the datasets they are attempting to ftp. The agency Top Secret administrator supplies these permits.
6.1.2 GENERAL FTP WARNING: FTP was derived from an environment where commands are executed without second guessing the user. For example, if a user issued a command to delete a group of data sets, the system would do so without question and without such prompts as: "Are you sure?". It is in this vein that this warning is issued about FTP. FTP assumes that you know what you are doing. If you transfer data to an existing file on the MVS host, using either the server ftp OR the client ftp, the server ftp will not warn you that you are about to overwrite the file. There MAY be some client programs that supply a warning, but in general, the existing file will be erased and replaced by the output of the current ftp.
6.1.3 DATASET NAMES: Dataset names on the MVS host must follow MVS standards. After a user logs on to the MVS host using ftp, their default "directory", in terms of UNIX OR DOS, is their userid. To access other datasets, you must surround the dataset name by single quotes. The member FTPSRVR in the TS.TCPILNK.INFO dataset contains details on how to use the cd (change directory) command to enable the listing of directories, etc. The same member also describes commands and other parameters that will allow you to specify record lengths, volumes, and other parameters that affect MVS datasets.
6.2 Server FTP from TSO: You must have a TSO userid to use this scenario. This example depicts how to transfer a plain-text file from a UNIX host to the MVS host. Note that each operating system has its own version of ftp and many of the prompts shown will vary depending on the particular system.
========================= Screen 1 ==============================
OPTION ===> 1
USERID -daxxyz
1 INVOKE ISPF/PDF TIME -10:33
2 READY SCREEN PF KEYS -24
Welcome to TSO using ISPF
From this screen you can select two options, #1 will take you to the primary selection menu for ISPF and #2 will take you out of ISPF, back to basic TSO. From either option, you may execute commands and/or programs as desired.
To use one of the many programs supported by DISC, select option #6 from the ISPF primary menu and enter the command for the desired facility, some examples follow:
ESFPRNT for ESF ISPSASU for SAS
=================================================================
TSO Main Menu
========================= Screen 2 ==============================
------------ ISPF/PDF PRIMARY OPTION MENU ------------
OPTION ===> ftp
-ISPF Functions- USERID -daxxyz
0 ISOPF PARMS - Specify terminal and user parameters TIME -10:50
1 BROWSE - Display source data or output listings TERML -3278
2 EDIT - Create or change source data PF KEYS -24
3 UTILITIES - Perform utility functions
4 FOREGROUND - Invoke language processors in foreground
5 BATCH - Submit job for language processing
6 COMMAND - Enter TSO Command, CLIST, or REXX exec
T TUTORIAL - Display information about ISPF/PDF list defaults
-----------------------------------------------------------------------------------------------------
Licensed Materials - Property of IBM
5665-402 (C) Copyright IBM Corp. 1980, 1991.
All rights reserved.
US Government Users Restricted Rights-
Use, duplication or disclosure restricted
by GSA ADP Schedule Contract with IBM Corp.
------------------------------------------------------------------------------------------------------
Enter END command to terminate ISPF.
=================================================================
Enter ftp command from ISPF Menu
=========================Screen 3 ==============================
SNS/TCP V2.0.0 User FTP2 - Enter command or '?'
FTP2:
=================================================================
FTP Prompt
The following script is an annotated log showing the remaining ftp prompts and user responses. Entries after the FTP2: prompt are commands typed by the user and numbered items are FTP responses. When three asterisks appear (***), you must press the Enter key. Notes and comments are enclosed in standard slashes and asterisks like: /* This is a comment */
/* START OF FTP LOG */
FTP2: open host1.da.state.ks.us /* Open the host system by name or IP address */
220 host1 FTP server (SunOS 4.1) ready.
FTP2: Enter name (host1:daxxyz): daxxyz /* Enter your login name to the remote host */
ACC718A Enter password /* Password is NOT displayed */
230 User daxxyz logged in.
FTP2: pwd /* pwd shows the current working directory */
257"/home/u/daxxyz" is current directory.
FTP2: ls /* ls lists the files in the current directory */
-Dataset open with attributes:
Type A N Tabs 8 Stru F Mode S Recall 5 /* The output of the ls command is */
Path DAXXYZ.FTP.TMP.T1447329 /* transferred as a temporary ascii file, */
Volser KPS010 Unit SYSDA Dsorg PS Recfm FB Lrecl 80 /* displayed, and then */
Blksize 6160 Space 5 15 Tracks Rlse /* deleted. */
150 ASCII data connection for /bin/Is (165.201.999.25,4110)
(0 bytes).
-Transfer complete
313 bytes received in 0.03 seconds (10433 bytes/s)
Path DAAXYZ.FTP.TMP.T1447329 User DAAXYZ Data bytes received 255
Disk tracks written l Records padded 29
226 ASCii Transfer complete
*** /* Three'*' - You must press the enter key to continue*/
cert
cert2
flat10.txt /* Here is the list of files */
snark.txt
twocity.txt
IDC05501 ENTRY (A) DAAXYZ.FTP.T1447329 DELETED
FTP2: get twocity.txt 'daaxyz.ftp.test' /* retrieve twocity.txt and store it in an MVS */
-Dataset open with attributes: /* filename: daaxyz.ftp.test */
Type A N Tabs 8 Stru F Mode S Recall 5
Path DAAXYZ.FTP.TEST
Volser KPS028 Unit SYSDA Dsorg PS Recfm FB Lrecl 80
Blksize 3120 Space 5 15 Tracks Rlse
150 ASCII data connection for twocity.txt (165.201.999.25,4116)
(760699 bytes).
FTP2:
/* At this point, you must press the enter key until the Transfer complete message appears (as shown below) */
226 ASCII Transfer complete.
FTP2: bye /* Logoff the remote host */
221 Goodbye.
221 Session terminated
***
/* END OF FTP LOG */
If you want to transfer a file from the MVS host to the remote host, you would use the 'put' command instead of 'get'.
6.3 SERVER BATCH FTP: To use batch ftp, you must have a Roscoe or TSO signon. Batch FTP will execute commands on a host running an FTP server. Before attempting to automate a job with these batch facilities, it would be best to use an interactive FTP session from TSO, like the one above, to determine what prompts the ftp server machine uses. This will help to determine what commands are required to successfully complete the transfer. During an interactive session, there is a human watching the results of the commands as they are entered and corrections may be easily made. In the batch program , the ftp commands are executed (or at least attempted) no matter what errors might have occurred during the command sequence.
6.3.1 Host ID and password security: Interlink has built a feature into their program to allow the user to build a file containing host names, userids, and passwords that may be referenced by the MVS transfer program. If you use your TSO userid as the first qualifier on this dataset, it will prevent other users from accessing the file. If you choose not to use this file, you must code the userid and passwords in your batch jobs, where they might be visible to more people.
6.3.2 Create a host login file: Create a dataset with an 80-byte record, permanent sequential dataset with the name 'youruserid.ftp.netrc', where your userid is your Top Secret userid. Place the following information into the file, substituting your machine names, logins, and userids. These names, logins and userids are case-sensitive!
MACHINE ip.host
LOGIN user1
PASSWORD zP6uy3
MACHINE another.ip.host
LOGIN greatone
PASSWORD toP7H8at
6.3.3 The next step is to create a JCL jobstream to transfer the file. Use the example below, substituting the information noted.
//* YOUR JOBCARD INFORMATION HERE
//*
//* CHANGES YOU MUST MAKE TO THIS JOB:
//*
//* 1)PUT A JOBCARD AT THE TOP
//* 2)CHANGE ip.host TO MATCH THE MACHINE NAME IN YOUR
//* NETRC FILE. NOTE THE CASE.
//* 3)CHANGE THE //FTP2.NETRC DSN NAME TO YOUR NETRC//* FILE
//* 4)CHANGE SOUT=X TO THE OUTPUT CLASS YOU DESIRE
//* 5)CHANGE yourdatasetname IN THE GET STATEMENT TO A//* VALID DATASET NAME THAT YOU ARE AUTHORIZED TO//* CREATE
//*
//GOFTP EXEC PROC=FTPBTCH,SOUT=X
//FTP2.NATRC DD DSN=your_userid.FTP.NETRC,DISP=SHR
//FTP2.SYSGET DD *
OPEN ip.host
cd /pub
get public.file.1 'yourdatasetname'
close
bye
/*
//
When this job is submitted, it will execute with the login and password that you put into your 'userid.ftp.netrc'file.
Here is a possible sample output from this job:
4:50:34---GREETINGS---
4:50:34 SNS/TCP V2.0.0 User FTP2 © Enter command or '?'
4:50:34 USERFTP: OPEN ip.host
4:50:36 220 ip.host FTP server (SunOS 4.1) ready.
4:50:37 230 User user1 logged in.
4:50:37 USERFTP: cd /pub
4:50:38 250 CWD command successful.
4:50:38 USERFTP: get public.file.1 'da.test.ftp.data'
4:50:40 -Dataset open with attributes:
4:50:41 Type A N Tabs 8 Stru F Mode s Recall 5
4:50:41 Path DA.TEST.FTP.DATA
4:50:41 Volser KPS406 Unit POOL4 Dsorg PO Recfm FB Lrecl 80
4:50:41 Blksize 23440 Space 5 15 Tracks Rlse
4:50:42 150 ASCII data connection for public.file.1
(165.201.25.2,4168) (7609 bytes)
4:50:42 -Transfer complete
4:50:42 7719 bytes received in 0.11 seconds
(70172 bytes/s)
4:50:43 Path DA.TEST.FTP.DATA User TSSYCWK
4:50:43 Data bytes received 7499
4:50:43 Disk tracks written 2 Records padded 109 Records folded 5
4:50:44 226 ASCII Transfer complete
4:50:44 USERFTP: close
4:50:55 USERFTP: bye
Samples of the FTP.NETRC and the job above may be found in the TS.TCPILNK.INFO dataset.
6.4 CLIENT FTP allows the MVS host to act as an ftp server and to accept ftp requests from other machines. The user is required to have a Top Secret signon with the SNSTCP facility. A TSO logon is NOT required. The following example uses a ftp client program from a PC running the tcp/ip stack from FTP Software. Client FTP software interfaces vary greatly and this is only one example.
C:\>ftp mvsl.da
FTP Software PC/TCP File Transfer Program v2.3 11/10/93 00:50
Copyright (c) 1986©1993 by FTP Software, Inc. All rights reserved.
220 MVS1.DA.STATE.KS.US©©FTP Server, Enter command or HELP
Userid for logging in on mvs1.da.state.ks.us (kinnett)?tssycwk
331 Enter PASS command
Password for logging in as tssycwk on mvs.1.da.state.ks.us?
230---GREETINGS---
TSS7003W Password Will Expire on 07/24/95
Host 165.201.25.2 User TSSYCWK
ftp:mvs1.da.state.ks.us>ls
IPCS.DDIR
IPCS.DDIR.D
IPCS.DDIR.I
ISPF.ISPPROF
ISPF659.OUTLIST
Transferred 78 bytes in 2 seconds (312 bits/sec,39 bytes/sec)
226-Transfer complete
78 bytes sent in 0.64 seconds (121 bytes/s) Path TSSYCWK.
User TSSYCWK Data bytes sent 66
226
ftp:mvs1.da.state.ks.us> get spf659.outlist spf659.txt
Transferred 1146 bytes in 2 seconds (4584 bits/sec, 573 bytes/sec)
226-Transfer complete
1146 bytes sent in 0.47 seconds (2438 bytes/s)
Path TSSYCWK.SPF659.OUTLIST User TSSYCWK Data bytes sent 3458
Disk tracks read 1
226
ftp:mvs1.da.state.ks.us> bye
7.0 CANCELLATION: This is a new publication
8.0 CONTACT PERSON: Boyce McCarter - Bureau of Information System, 785-296-3343