Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FTP error checking

72 views
Skip to first unread message

Ryerse, Robin

unread,
Jan 6, 2004, 11:55:58 AM1/6/04
to
Does anyone have an exec that generically inspects the SYSPRINT generated
from executing FTP in batch?

Alternately, an exec that runs FTP itself then scrapes the SYSPRINT would
help.

tia

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

Paul Lautman

unread,
Jan 6, 2004, 12:13:22 PM1/6/04
to
I had a PIPELINE embedded in my JCL that inspected the OUTPUT (as opposed to
the SYSPRINT) from an FTP step. If the FTP was successful then it deleted
the local file, oterwise it XMITted the output to a key user:

//OUT01 DD DSN=&DSNAME.,
// DCB=(LRECL=&LENGTH.,BLKSIZE=0,RECFM=FB),
// DISP=(,CATLG),UNIT=(SYSDA,8),SPACE=(TRK,(1,1),RLSE)
//*
//S002 EXEC PGM=FTP,REGION=2048K
//*SYSPRINT DD SYSOUT=*
//*OUTPUT DD SYSOUT=*
//SYSPRINT DD *
//*OUTPUT DD DISP=(NEW,PASS),DCB=(LRECL=133,BLKSIZE=0,RECFM=FBA)
//OUTPUT DD DISP=(NEW,PASS)
//INPUT DD *
22.139.255.77
pager
pager
bin
put '&DSNAME.' &DSNAME.
quit
/*
//S003 EXEC PGM=PIPE,
// PARM='QSAM PIPE|CHOP STR /--/|JOIN *|RUNPIPE|PAD 80|QSAM PIPEMSG'
//PIPEMSG DD *
//TEMP01 DD DISP=(NEW,PASS),DCB=(LRECL=80,BLKSIZE=0,RECFM=FB)
//FTPOUT DD DSNAME=*.S002.OUTPUT,DISP=(OLD,PASS)
//SYSTSPRT DD *
//PIPE DD *
(END \)
|< DD=FTPOUT -- Read FTP Output
--|cons -- Remove -- at begining to see FTP Output
|STRFIND /EZA1617I/ -- Look for "TRANSFERRED" message
|COUNT LINES -- Count = 0 if not found
|S:STRFIND /0/ -- If not found then tell someone
|SPEC /XMIT PCCVSNHA.U051819 DD(FTPERR) NONOT/ N
|F:FANINANY -- Funnel in streams
|> DD=TEMP01 coerce -- Output TSO command(s) to temp dataset
\S: -- Transfer OK so delete dataset
|SPEC /DELETE '&DSNAME'/ N
|F:
/*
//*
//S004 EXEC PGM=IKJEFT01
//FTPERR DD DSNAME=*.S002.OUTPUT,DISP=(OLD,PASS)
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DSNAME=*.S003.TEMP01,DISP=(OLD,PASS)
//SYSTSIN DD *
/*

Robert Zenuk

unread,
Jan 6, 2004, 12:23:33 PM1/6/04
to
I have one that is designed specifically for FTP PUT's (called FTPPUT). What
are you looking for? Mine allows you to add any number of FTP* DD's (SEQ,
PDS, HFS or VSAM) and it will PUT, MPUT or sequentialize then PUT (for VSAM) to
a common destination. It gives good return codes (exploits the "(EXIT" FTP
syntax) and will dump the contents of the FTP OUTPUT DD if any error occurs.
FTP uses the INPUT and OUTPUT DD statements instead of SYSIN and SYSPRINT when
invoked from TSO/REXX.

I have found the SYSPRINT DD statement in the original TCP/IP utility
implementations difficult to work with. I have found the OUTPUT DD in FTP and the
"o" versions of the TCP/IP utilities (like orexec instead of rexec) easier to
wrap REXX around (using BPXBATCH).

If my FTPPUT is run with several FTP* DD's it will attempt to send all files
even if one of the first files gets and error (returned RC=4 and a detailed
report of each file's RC). When knowledge of each individual file's RC is
needed in the JCL, I recommend sending one file per FTPPUT step.


Let me know if this will help,

Rob

Ryerse, Robin

unread,
Jan 6, 2004, 12:38:46 PM1/6/04
to
Thanks for the "heads-up" Robert.

The intention is to generate warnings/alerts (non-zero step return code)
that the batch FTP transmission was incomplete regardless of the direction
of data flow.

Robert Zenuk

unread,
Jan 6, 2004, 12:58:07 PM1/6/04
to
If that is all you are trying to do, the example in the IP User's Guide is
pretty good (NETRC is optional if you don't mind putting ID's and passwords in
the INPUT stream).

//USER28F JOB ,CARTER,MSGLEVEL=(1,1)
//FTPSTP1 EXEC PGM=FTP,REGION=2048K,
// PARM='9.67.112.25 (EXIT TIMEOUT 20'
//NETRC DD DSN=ANYHLQ.NETRC,DISP=SHR
//SYSPRINT DD SYSOUT=H
//OUTPUT DD SYSOUT=H
//INPUT DD *
type e
mode b
put idss.parts
/*

The (EXIT causes dependable return codes that can be tested in JCL. The
other thing that my FTPPUT did was support GDG's. Looking at the z/OS 1.3 manual,
it appears IBM fixed that little annoyance.

The IP User's Guide is pretty good for FTP. Here is the link to the FTP
Batch section.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/F1AA2032/1.4.8?DT=2
0001127174124

The return codes are usually 5 digits long. The first 2 digits tell you
which command failed and the last 3 indicate the problem. This is also documented
in the IP User's Guide.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/F1AA2032/1.4.10?DT=
20001127174124


Hope This Helps,

Ryerse, Robin

unread,
Jan 6, 2004, 1:45:24 PM1/6/04
to
Cripes .... I knew that (at one time). Thanks for the reminder.

When your only tool is a hammer, every problem looks like a nail. ... a
review of the toolkit is in order.

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU]On Behalf
Of Robert Zenuk
Sent: Tuesday, January 06, 2004 12:58 PM
To: TSO-...@VM.MARIST.EDU
Subject: Re: FTP error checking

Stephen E. Bacher

unread,
Jan 6, 2004, 4:56:00 PM1/6/04
to
In general, the best approach is to look for the "success" message code
and barf if you don't see it, rather than trying to grok all of the
various error message texts.

- seb

Frank Clarke

unread,
Jan 6, 2004, 7:20:07 PM1/6/04
to
On 6 Jan 2004 09:58:07 -0800, Robz...@AOL.COM (Robert Zenuk) wrote:
<124.29a822...@aol.com>

>The return codes are usually 5 digits long. The first 2 digits tell you
>which command failed and the last 3 indicate the problem. This is also documented
>in the IP User's Guide.

After you have parsed the return code (ssrrr) into ss and rrr:

subcmd. = "Invalid"
subcmd.1 = "AMBIGUOUS"
subcmd.2 = "?"
subcmd.3 = "ACCOUNT"
subcmd.4 = "APPEND"
subcmd.5 = "ASCII"
subcmd.6 = "BINARY"
subcmd.7 = "CD"
subcmd.8 = "CLOSE"
subcmd.9 = "TSO"
subcmd.10 = "OPEN"
subcmd.11 = "DEBUG"
subcmd.12 = "DELIMIT"
subcmd.13 = "DELETE"
subcmd.14 = "DIR"
subcmd.15 = "EBCDIC"
subcmd.16 = "GET"
subcmd.17 = "HELP"
subcmd.18 = "LOCSTAT"
subcmd.19 = "USER"
subcmd.20 = "LS"
subcmd.21 = "MDELETE"
subcmd.22 = "MGET"
subcmd.23 = "MODE"
subcmd.24 = "MPUT"
subcmd.25 = "NOOP"
subcmd.26 = "PASS"
subcmd.27 = "PUT"
subcmd.28 = "PWD"
subcmd.29 = "QUIT"
subcmd.30 = "QUOTE"
subcmd.31 = "RENAME"
subcmd.32 = "SENDPORT"
subcmd.33 = "SENDSITE"
subcmd.34 = "SITE"
subcmd.35 = "STATUS"
subcmd.36 = "STRUCT"
subcmd.37 = "SUNIQUE"
subcmd.38 = "SYSTEM"
subcmd.39 = "TRACE"
subcmd.40 = "TYPE"
subcmd.41 = "LCD"
subcmd.42 = "LOCSITE"
subcmd.43 = "LPWD"
subcmd.44 = "MKDIR"
subcmd.45 = "LMKDIR"
subcmd.46 = "EUCKANJI"
subcmd.47 = "IBMKANJI"
subcmd.48 = "JIS78KJ"
subcmd.49 = "JIS83KJ"
subcmd.50 = "SJISKANJI"
subcmd.51 = "CDUP"
subcmd.52 = "RMDIR"
subcmd.53 = "HANGEUL"
subcmd.54 = "KSC5601"
subcmd.55 = "TCHINESE"
subcmd.56 = "RESTART"
subcmd.99 = "UNKNOWN"

reason. = "??" /* default
*/
reason.000 = "FTP subcommand contains an incorrect parameter"
reason.110 = "Restart marker reply"
reason.120 = "Service ready in nnn minutes"
reason.125 = "Data connection already open; transfer starting"
reason.150 = "File status okay; about to open data connection"
reason.200 = "Command okay"
reason.202 = "Command not implemented; not used on this host"
reason.208 = "Unable to delete data set because expiration date",
"has not passed"
reason.211 = "System status, or system help reply"
reason.212 = "Directory status"
reason.213 = "File status "
reason.214 = "Help message"
reason.215 = "MVS is the operating system of this server"
reason.220 = "Service ready for new user"
reason.221 = "QUIT command received"
reason.226 = "Closing data connection; requested file action",
"successful "
reason.230 = "User logged on; proceed"
reason.250 = "Requested file action okay, completed"
reason.257 = "PATH NAME created"
reason.331 = "Send password please"
reason.332 = "Supply minidisk password using account"
reason.421 = "Service not available"
reason.425 = "Cannot open data connection"
reason.426 = "Connection closed; transfer ended abnormally"
reason.450 = "Requested file action not taken; file busy"
reason.451 = "Requested action abended; local error in processing"
reason.452 = "Requested action not taken; insufficient storage",
"space in system"
reason.500 = "Syntax error; command unrecognized"
reason.501 = "Syntax error in parameters or arguments"
reason.502 = "Command not implemented"
reason.503 = "Bad sequence of commands"
reason.504 = "Command not implemented for that parameter"
reason.530 = "Not logged on"
reason.532 = "Need account for storing files"
reason.550 = "Requested action not taken; file not found or no",
"access "
reason.551 = "Requested action abended; page type unknown"
reason.552 = "Requested file action ended abnormally; exceeded",
"storage allocation"
reason.553 = "Requested action not taken; file name not allowed"
reason.554 = "Transfer aborted; unsupported SQL statement"

say subcmd.ss""reason.rrr

(change Arabic number to Roman numeral to email)

0 new messages