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

FTP EBCDIC to ASCII

1,706 views
Skip to first unread message

Kenneth Murray

unread,
May 6, 1996, 3:00:00 AM5/6/96
to

Does anyone know if you can FTP a file from an AS/400 to a PC and have
it automatically convert to ASCII? Currently I have to do a PC
Support download to ASCII and then I have to FTP it to a UNIX MACHINE.

Suggestions are greatly appreciated!


Paul Malt

unread,
May 7, 1996, 3:00:00 AM5/7/96
to

In article <4mm1e6$3...@news-central.tiac.net>,
I have recently setup a "batch" job to FTP an AS/400 file direct to a UNIX
box. You can translate the file automatically.

Below is the commands...

<<userid>>
USER <<userid>> <<password>>
ASCII
PUT QFFLIB/LIFF51CSV
PUT QFFLIB/LIFF52CSV
PUT QFFLIB/LIFF53CSV
CLOSE
QUIT


lwl...@rchland.vnet.ibm.com

unread,
May 7, 1996, 3:00:00 AM5/7/96
to

> g...@tiac.net (Kenneth Murray) writes:
> Does anyone know if you can FTP a file from an AS/400 to a PC and have
> it automatically convert to ASCII? Currently I have to do a PC
> Support download to ASCII and then I have to FTP it to a UNIX MACHINE.
>
> Suggestions are greatly appreciated!
>

I'm not sure what the problem is. At this very moment, I am using my PC at home.
I will send this posting from it.

It connects to our large, multi-system network via TCP and PPP.

I simply go "FTPw AS400HostName" (FTPw
is the name used for FTP on my PC's software using Winsock) and everything works fine,
including automatic translation to ASCII and conversion from the AS/400 fixed file format to
PC variable length files, near as I can tell. Certainly, what I download, I can sure edit.

As long as your PC connects to TCP/IP somehow, somewhere, there should be no problem.

I don't personally use Client/Access, but I'm sure translation on download is quite
possible.

--

Larry W. Loen | Science often trades an exciting fact
| for a comforting myth

email to: lwl...@rchland.vnet.ibm.com


Matthew Sanderson

unread,
May 7, 1996, 3:00:00 AM5/7/96
to

Paul Malt (ma...@sunfish.cbd.dpi.qld.gov.au) wrote:
: In article <4mm1e6$3...@news-central.tiac.net>,
: g...@tiac.net (Kenneth Murray) wrote:
: > Does anyone know if you can FTP a file from an AS/400 to a PC and have

: >it automatically convert to ASCII? Currently I have to do a PC
: >Support download to ASCII and then I have to FTP it to a UNIX MACHINE.
: >
: >Suggestions are greatly appreciated!

PMJI, but has anyone else had the problem on an ftp from the AS/400
to the PC in that the resulting file has "wrong length record"?
From what I can observe, some AS/400 fields, with spaces lost
those spaces on the way (somewhere) and those fields are wrong
length on the PC. This is with Wfwg 3.11 + MSTCP32 + Rumba's FTP.

Thanks;
--
/ Matthew Sanderson CS: 70733,2700 'net: matt...@hookup.net \
\ http://www.hookup.net/~matthews /

Scott R. Keszler

unread,
May 7, 1996, 3:00:00 AM5/7/96
to

In article <4mm1e6$3...@news-central.tiac.net>,
g...@tiac.net (Kenneth Murray) wrote:
} Does anyone know if you can FTP a file from an AS/400 to a PC and have
}it automatically convert to ASCII? Currently I have to do a PC
}Support download to ASCII and then I have to FTP it to a UNIX MACHINE.

The FTP protocol handles the translation - _except_ for packed decimal fields.
If you have any packed decimal fields you'll have to create a new file to ftp.
I needed to do this; used Query/400 and the DIGITS function. (Small file and I
was in a hurry...)

Assuming the AS/400 is V3R1 and is on the same ether/token_ring network as the
unix box, just type FTP (or STRTCPFTP) at an AS/400 command line. Enter the IP
address or name of the unix system and you'll connect. Use PUT and GET
commands as you normally would. The filename format on the 400 is
DIRPATH/FILENAME.MEMBERNAME - if you PUT the FILENAME without the .membername
I believe it ftps _all_ members.


Scott R. Keszler-------------------------------------------------SRK Consulting
Computer consulting and custom programming. Unix, AIX, OS/400, and PCs. EDI.
Finger for detail. Hard Drive Clocks: http://rrnet.com/~keszler/hddclock.html
keszler@rrnet.com-------------------------------------http://rrnet.com/~keszler

Kenneth Murray

unread,
May 7, 1996, 3:00:00 AM5/7/96
to

I should have expanded the question to include Packed fields. Is
there a way to have FTP translate an EBCDIC File to an ASCII file?
Including Packed Fields?

Thanks for all your responses...


g...@tiac.net (Kenneth Murray) wrote:

> Does anyone know if you can FTP a file from an AS/400 to a PC and have
>it automatically convert to ASCII? Currently I have to do a PC
>Support download to ASCII and then I have to FTP it to a UNIX MACHINE.

>Suggestions are greatly appreciated!


dr...@mnsinc.com

unread,
May 7, 1996, 3:00:00 AM5/7/96
to

In Article<4mml97$14...@news.rchland.ibm.com>, <lwl...@rchland.vnet.ibm.com> write:
> Path: news1.mnsinc.com!imci2!imci3!imci4!newsfeed.internetmci.com!howland.reston.ans.net!newsjunkie.ans.net!newsfeeds.ans.net!news.chips.ibm.com!mdnews.btv.ibm.com!news.rchland.ibm.com!usenet
> From: lwl...@rchland.vnet.ibm.com
> Newsgroups: comp.sys.ibm.as400.misc
> Subject: Re: FTP EBCDIC to ASCII
> Date: 7 May 1996 04:58:15 GMT
> Organization: IBM Corp
> Lines: 30
> Message-ID: <4mml97$14...@news.rchland.ibm.com>
> References: <4mm1e6$3...@news-central.tiac.net>
> NNTP-Posting-Host: htp1139.rchland.ibm.com
> X-Newsreader: SPRY News 3.03 (SPRY, Inc.)


>
> > g...@tiac.net (Kenneth Murray) writes:
> > Does anyone know if you can FTP a file from an AS/400 to a PC and have
> > it automatically convert to ASCII? Currently I have to do a PC
> > Support download to ASCII and then I have to FTP it to a UNIX MACHINE.
> >
> > Suggestions are greatly appreciated!
> >
>

> I'm not sure what the problem is. At this very moment, I am using my PC at home.
> I will send this posting from it.
>
> It connects to our large, multi-system network via TCP and PPP.
>
> I simply go "FTPw AS400HostName" (FTPw
> is the name used for FTP on my PC's software using Winsock) and everything works fine,
> including automatic translation to ASCII and conversion from the AS/400 fixed file format to
> PC variable length files, near as I can tell. Certainly, what I download, I can sure edit.
>
> As long as your PC connects to TCP/IP somehow, somewhere, there should be no problem.
>
> I don't personally use Client/Access, but I'm sure translation on download
is quite
> possible.
>
> --
>
> Larry W. Loen | Science often trades an exciting fact
> | for a comforting myth
>
> email to: lwl...@rchland.vnet.ibm.com
>


There is an FTP command for conversion of EBCDIC to ASCII
and ASCII to EBCDIC.
If you using FTP from the AS/400 then sign on and enter the
command (for example):

ASCII
put customer/sales.info
quit

By the way ASCII is the default transfer type.
All this is in the TCP/IP Guide.

David J. Ritz


Dan Hicks

unread,
May 8, 1996, 3:00:00 AM5/8/96
to

In <4moime$3...@news-central.tiac.net>, g...@tiac.net (Kenneth Murray) writes:
>I should have expanded the question to include Packed fields. Is
>there a way to have FTP translate an EBCDIC File to an ASCII file?
>Including Packed Fields?

Basic problem: Packed fields aren't EBCDIC. In order to translate them
the transport mechanism must be aware of the file field formats. PC
Support et al understand field formats, FTP doesn't.

Dan Hicks
Hey!! My advice is free. Take it for what it's worth.
http://www.millcomm.com/~danhicks/


lwl...@rchland.vnet.ibm.com

unread,
May 9, 1996, 3:00:00 AM5/9/96
to

> g...@tiac.net (Kenneth Murray) writes:
> I should have expanded the question to include Packed fields. Is
> there a way to have FTP translate an EBCDIC File to an ASCII file?
> Including Packed Fields?
>

This really can't be done automatically by anyone anywhere.

Would you expect FTP to translate 16 bit binary numbers, too?
How about 32 bit integers?

The trouble here is that once you got into ASCII to EBCDIC or the
other way around, you are tacitly declaring _all fields_ in the record
to be one big character string.

But, if part of your record is a binary number or a packed decimal
number or a DOS Timestamp or. . . .

you are out of luck because FTP doesn't support any kind of notion
of data dictionary.

It means you have to do some sort of hand translation.

Jim Michael

unread,
May 10, 1996, 3:00:00 AM5/10/96
to

I have an application which must translate ansi to ebcdic. If anyone
needs the code (visual basic) I can post. I just use a lookup table.
Also have the opposite function.

Jim

lwl...@rchland.vnet.ibm.com wrote:

Dan Riehl

unread,
May 10, 1996, 3:00:00 AM5/10/96
to

On Tue, 07 May 1996 22:24:46 GMT, g...@tiac.net (Kenneth Murray) wrote:

>I should have expanded the question to include Packed fields. Is
>there a way to have FTP translate an EBCDIC File to an ASCII file?
>Including Packed Fields?
>

>Thanks for all your responses...

News/400 magazine published an article a few years ago that Unpacks
packed fields in any file. It's quite simple, but you might check with
them to see if you can get a copy of the code. It's a CL and RPG
solution. You can also get the code and the article in the book
"AS/400 PowerTools" from News/400 publishing company Duke Press.

The author of the article was Frank Villafane.

dan
________________________________________________________
Dan Riehl
Seattle, Wa
dri...@toolnet.com
________________________________________________________

Rick Enos

unread,
May 10, 1996, 3:00:00 AM5/10/96
to

lwl...@rchland.vnet.ibm.com wrote:
>
> > g...@tiac.net (Kenneth Murray) writes:
> > I should have expanded the question to include Packed fields. Is
> > there a way to have FTP translate an EBCDIC File to an ASCII file?
> > Including Packed Fields?
> >
>
> This really can't be done automatically by anyone anywhere.
> Larry:
We can!!

TCP/Utilities for the AS/400
Riverside Data Systems, Inc.
www.businesson.com/rds

Dave Plonka

unread,
May 14, 1996, 3:00:00 AM5/14/96
to

I've been reading this thread and have a related question...

One of our customers is doing ftp transactions to us from their AS/400
host. These are fixed length ascii files on our Unix host.

What where seeing is that they're stripping trailing blanks (possibly
all whitespace) such that if they grab a text file from us, and put it
back it differs from the original in that all trailing ascii space
characters are trimmed.

Does the AS/400 have a file/record type that can represent the file
closer to the way we see it on our Unix host (retaining all characters)?

(Or is the AS/400 ftp doing the "best it can" to massage a Unix
variable-lenth, line-feed terminated stream file into what is "natural"
for it?)

If not, we can change our application to handle this, but I'd like
to be sure it can't be addressed by the ftp server/client on the AS/400
side.

Please email. Thanks much,
Dave

--
Dave Plonka ARS:N9HZF mailto:Dave....@mfa.com Waukesha, Wisconsin

0 new messages