× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: FTP exit
  • From: Rob Berendt <rob@xxxxxxxxx>
  • Date: Mon, 15 Jun 1998 9:50:16 -0500

I must have gotten into this thread late.

When you initiate FTP from the 400:
FTP on the AS/400 allows batch processing using a "file"
called INPUT...if you
OVRDBF FILE(INPUT) TOFILE(SCRIPT)
where SCRIPT is a file containing FTP commands, then run
FTP <system name>, the commands in SCRIPT are run
automagically.  You can also override file OUTPUT in the
same manner and get a "log" of the FTP command results.
BIG drawback is you've gotta put the password in the file -
once you OVRDBF, *ALL input to FTP has to come from
your overridden file.

When the contact is from the other machine to the AS/400 the situation is 
different.  You can use an exit point program to determine when a transfer 
STARTS, not when it ends.  We have our customers run a script that sends the 
file and executes a command on the 400 to process the file.  Yes, you can 
secure the commands.  Some customers FTP does not allow them to start commands 
on the 400.  Strangely enough it is IBM's AIX that doesn't support this FTP 
subcommand.  In this case they send a secondary file.  This 'trojan horse' 
tells us to process the first file.  For examples of this code see the redbook 
'Cool title about the AS/400 and the Internet' available online at the IBM 
site.  I cut and pasted the program and modified it from there.

For the communications of files I would strongly recommend some techniques 
common among the EDI world.  Put in a header record that tells you how many 
records you will receive.  Follow your data with a trailer record that tells 
you how many records that you received.  Include a field in the trailer record 
that is a hash total of some field in the data.  For example:
- - FILEA - -
HEADER, 5
ITEMA, 400, 4.95, 1980.00
ITEMB, 75, 72.00, 5400.00
ITEMXYZ, 2, 19.95, 39.90
ITEMQ, 5, 0.05, 0.25
ITEMX, 27, 13.00, 351.00
TRAILER, 5, 509

For better examples you can consult the ANSI X.12 manuals.





hambergv@goldengate.net on 06/15/98 12:09:32 AM
Please respond to MIDRANGE-L@midrange.com@Internet
To:     MIDRANGE-L@midrange.com@Internet
cc:     toche@sbbio.be@Internet 
Subject:        Re: FTP exit

Andre

At 12:12 PM 5/31/1998 +0200, you wrote:
>
>We have a lot of ftp initiated by the as/400. They work very well and we
use the
>      log to check the good completion.
>
>But we want now to start FTP from a mainframe to the as/400. It works
well, but
>      the programmers would like to have some messages on the as/400
showing the
>      status of the transfer.
>
>I suppose the only way is to have an exit on FTP which monitors the transfer.
>
>Does anyone have an example, or a model of an FTP exit ? (we have V4R1)

Is the 400 the server or the client? The following assumes the 400 is the
client.

As with all ftp implementations, there are messages returned to the client
system for each subcommand that executes on the server. These messages go
to STDOUT, or are redirected?OVRDBF or OVRPRTF in AS/400 terms.

There are no messages on the 400 during the process, unless you count the
byte count that appears at the bottom of the screen while a get/put is in
effect.

Come to think of it, though, you could use the 'syscmd' subcommand to
execute a 400 command. This could do anything allowed on a command line or
from a program, I think. It could?ooh, this is getting good!?call a program
that'd look at the output file up to that point (barring lock conflicts)
and check for return codes. Then it could send messages as needed. D'ya think?

These things would execute from an ftp script. See the TCP/IP Config & Ref
for details.

HTH

Vernon Hamberg
Systems Software Programmer
Old Republic National Title Insurance Company
400 Second Avenue South
Minneapolis, MN  55401-2499
(612) 371-1111 x480


+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.