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

AS400 and FTP

75 views
Skip to first unread message

Ernie Wegrecki

unread,
Jul 24, 1999, 3:00:00 AM7/24/99
to
I am trying to automate a file transfer from the AS400 to a network drive.
I want it to be translated to an ASCII Fixed length or ASCII delimited file.
FTP'ing it still leaves the data with a bunch of funny characters in it. Is
there a way to do this (I can do it with the Client Access or Attachmate
File Transfer, but I must have an active session to do that).

Any suggestions??

Thanks...Ernie

Jim Suiter

unread,
Jul 24, 1999, 3:00:00 AM7/24/99
to
Are any of the fields packed? If so, you may have to write data to another
file before
the file transfer to convert packed fields to zoned (or alpha). If the
drive is a mapped drive on the AS400, you shouldn't need FTP, you could use
the CPYTOPCD command to copy file to the folder.

Jim

Ernie Wegrecki <wegr...@advdata.net> wrote in message
news:93279678...@nntp.adni.net...

barbier

unread,
Jul 24, 1999, 3:00:00 AM7/24/99
to

Hi Ernie

An other way to do it,
You can use the 2 comands CPYTOIMPF and CPYTOSTMF to be shure to get the
right PCASCII format folow this procedure
(Ok it's a little bit long but i hav'nt find more simple yet !!)

Create a srcfile with a record length egal to your initial database file
plus a filer space need to unpack the numeric fields add decimal separator
and signe.
copy your database file in this source file by the CPYTOIMPF comand

CPYTOIMPF FROMFILE(EXTFILE) TOFILE(EXTFILESRC) +
MBROPT(*REPLACE) DTAFMT(*FIXED) +
RCDDLM(*EOR) +
DECPNT(*COMMA)

Then copy this source file in a stream file using the CPYTOSTMF comand

CPYTOSTMF +
FROMMBR('/QSYS.LIB/YOURLIB.LIB/EXTFILESRC.FILE/EXTFILE.MBR') +
TOSTMF('/tmp/EXTFILE.TXT') +
STMFOPT(*REPLACE) STMFCODPAG(*PCASCII)

(The CPYTOSTMF cannot copy multi field files...)

If you find better solution, thank you for email me
Bruno
Ernie Wegrecki a écrit dans le message <93279678...@nntp.adni.net>...

Wayne Charlton

unread,
Jul 26, 1999, 3:00:00 AM7/26/99
to
Hi there

Me and my colleague Victor did it a mucheasier wy if it is packed data -
just run a query over the file to an outfile, then send that. Dead easy.

Best Regards
Wayne Charlton
Greenib Car BV, The Netherlands

barbier <bar...@wanadoo.fr> schreef in berichtnieuws
7nbng2$o8s$1...@wanadoo.fr...

barbier

unread,
Jul 26, 1999, 3:00:00 AM7/26/99
to
Your solution is good for unpaked data but
I dont thing your solution avoid the use of an active session
to transfert data in PC format
.


Matthew Bieniek

unread,
Jul 26, 1999, 3:00:00 AM7/26/99
to
I used an RPG program to build a file (one 256 char field) that contained the
data in the format that I needed. I then used the AS/400 FTP commands in the CL
to move the file to the network. I found the sample code in one of the IBM
manuals and went from there. The great thing is that the whole process is
controlled from the AS/400, so you don't need to have a PC involved (except the
network drive, of course.)

Matt

0 new messages