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

FTP File with Packed Numeric Field

308 views
Skip to first unread message

Richard

unread,
Oct 7, 2002, 6:35:27 PM10/7/02
to
How to FTP a file (from AS400 to PC/workstation) with 'packed' numeric
fields? Is there a way to do this without first converting the packed
to zoned numeric field? If I have to convert, I tried AS400 Query to
create new file and it converted by default. Not too difficult, but
you have to do some typing. Better ideas? Many Thanks.

Dan Hicks

unread,
Oct 7, 2002, 8:23:48 PM10/7/02
to

You have to convert it to something, since PC (save for some
AS/400-specific programs) doesn't understand packed decimal.

--
Dan Hicks
I am a carnivorous fish swimming in two waters, the cold water
of art and
the hot water of science. --Salvador Dali

Steve Landess

unread,
Oct 7, 2002, 9:41:11 PM10/7/02
to
AFAIK, you must have the numeric fields in signed decimal format in order to
successfully perform EBCDIC to ASCII translation, unless you transfer it as
a binary (EBCDIC) to the PC and write code to translate the EBCDIC data
(yuk).

For production-type transfers, I usually create Data Description
Specifications (DDS) for a work file that looks exactly like the original
file except to redefine the packed fields as 'S' type instead of 'P' type.

I then CPYF FROMFILE(Originalfile) TOFILE(Workfile) MBROPT(*REPLACE) to copy
the original data to the work file, then I FTP the work file to the PC.

For ad-hoc transfers, query works ok...probably less work...


"Richard" <email2...@yahoo.com> wrote in message
news:28e66c74.02100...@posting.google.com...

Francis Lapeyre

unread,
Oct 7, 2002, 10:30:37 PM10/7/02
to

If the remote system can take the file as a comma-separated file (.CSV
format), use CPYTOIMPF to convert the file first.

Regards,
Francis Lapeyre

"Don't worry about the world coming to an end today. It's already tomorrow in Australia." --Charles Schultz

Karl Hanson

unread,
Oct 7, 2002, 11:06:18 PM10/7/02
to

I have not tried it, but a similar technique would be:
1) create a non-keyed logical file over the physical, redefining the
packed decimal fields as signed decimal
2) ftp from the logical file
That way no temp copy of the file (data) is needed, but the same
mapping occurs.

--
Karl Hanson

0 new messages