HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

TCPIP FTP status codes and associated messages

 
SOLVED
Go to solution
Jim Geier_1
Regular Advisor

TCPIP FTP status codes and associated messages

We have many DCL scripts that move files from OpenVMS systems to other systems in the enterprise using TCP/IP Services' FTP. To enhance the procedures that move files, I want to get the more common status codes and their meaning so the procedure can take appropriate action. For example, a return status code of %X176499F2 apparently translates to something like "the file is currently locked by another user".

1. How can I get a list of the FTP return status codes and their associates messages? Is there a means of getting this from the image sys$message:tcpip$msg.exe?

2. Is there a means of decoding the status code to get the facility, ident, and actual status code from the 32-bit status code? Seems like this was added to a lexical function for OpenVMS V8.3, but we are running V7.3-2.

Thanks!
2 REPLIES
Steven Schweda
Honored Contributor
Solution

Re: TCPIP FTP status codes and associated messages

alp $ sysmsg %X176499F2
(SYS$COMMON:[SYSMSG]TCPIP$MSG.EXE;1:)
%TCPIP-E-FTP_ERROR, FTP ERROR return code

I think that that one is less specific than
you think it is.

How are you using FTP? Plain-old FTP
command, COPY /FTP, or what?

1. Probably, but I don't know the secret.

2. This secret is hidden in:
SYS$COMMON:[DECC$LIB.REFERENCE.SYS$STARLET_C]STSDEF.H

As I read it, the facility is in bits 26:16,
the code is in 14:3, and the severity is in
2:0. And probably in the System Services
Reference Manual, too. What's an "actual
status code"?
John Gillings
Honored Contributor

Re: TCPIP FTP status codes and associated messages

Jim,

Your best bet is to get hold of a listing kit and examine TCPIP$MSG.MSG.

A brute force approach is to try every possible status value for the facility, for example:

FINDMESSAGES.COM
$ IF p1.EQS."" THEN INQUIRE p1 "Status code"
$ code=p1.AND.%XFFF0000
$ end=code+%X10000
$ loop: msg=F$MESSAGE(code)
$ IF msg-"NOMSG"-"NONAME".EQS.msg THEN WRITE SYS$OUTPUT -
F$FAO("!8XL = !AS",code,msg)
$ code=code+8
$ IF code.LT.end THEN GOTO loop

First you need to execute:

$ SET MESSAGE SYS$MESSAGE:TCPIP$MSG

Feed it your sample code and it will generate a list. You could add code to hunt SYS$MESSAGE for a file containing your facility messages... left as an exercise ;-)

Note however, that with this code, all messages found will be -W- severity. There's no simple way to know the intended severity for a particular message, as the code is orthogonal to severity.

Also, be careful when comparing status codes. You should mask off the flags and severity.

If you don't have a C compiler you can find the structure definitions with:

$ lib/extr=$stsdef/out=tt sys$share:starlet/mac

The ones of interest for masking out pieces of the code are:

$EQU STS$M_SEVERITY <^X7>
$EQU STS$M_COND_ID <^XFFFFFF8>
$EQU STS$M_CONTROL <^XF0000000>
$EQU STS$M_SUCCESS <^X1>
$EQU STS$M_MSG_NO <^XFFF8>
$EQU STS$M_CODE <^X7FF8>
$EQU STS$M_FAC_SP <^X8000>
$EQU STS$M_CUST_DEF <^X8000000>
$EQU STS$M_INHIB_MSG <^X10000000>
$EQU STS$M_FAC_NO <^XFFF0000>

A crucible of informative mistakes