Hi guys,
Thanks for your time.
I'm trying to copy a file from:
Library: eiqry01
File: itemmaster
I need to transform this file to a txt file in order that another
application can read it.
Well my first idea was to copy this file directly to a windows 2000
server share, but if it's not possible, maybe if I can transform this
file (eiqry01/itemmaster) or copy into another library that can be
accessible from windows.
Is there's another way to turn accessible this file so a windows
application can read, please tell me.
I also heard about FTP, but with that I'm even lost.
Any ideas?
Thanks,
Marco
Obrigado,
Marco Silva
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: quinta-feira, 30 de Agosto de 2007 18:47
To: Midrange Systems Technical Discussion
Subject: Re: CPYTOIMPF
Hello Marco,
Who help me with the command CPYTOIMPF?
I'll try -- what do you want to know?
I don't know is it is to ask to much, but if it possible could you
send
me a print?
I see from the MI list that what you're really looking for is the manual
page for the CPYTOIMPF command. IBM has lots of info in the Information
center. Take a look:
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/d
m/rbal3usingcpyto.htm
Here's an example. Let's say I have a file named CUSTMAS in a library
named FILES. I want to copy it to my PC, which is named 'scottk'. On
that PC, I've shared a directory named 'Incoming' and I'd like to put
the file there.
I want the PC file to be in ASCII and in tab-delimited format, so I can
open it in Excel. Here's what I type:
CPYTOIMPF FROMFILE(FILES/CUSTMAS)
TOSTMF('/qntc/scottk/Incoming/custmas.tab')
FROMCCSID(*FILE)
STMFCODPAG(*PCASCII)
DTAFMT(*DLM)
RCDDLM(*CRLF)
STRDLM(*NONE)
FLDDLM(*TAB)
Here's what it means:
TOSTMF tells it where to put the resulting stream file. On i5/OS, any
IFS path that starts with /QNTC tells it to use Windows Networking. It
will use Windows Networking to find the host named 'scottk', and it will
send the file to the shared directory named 'Incoming', and the file on
the PC will be called 'custmas.tab'
FROMCCSID tells the system what the CCSID of the existing data file is.
The special value *FILE means it'll look for the CCSID in the file
description. On my system, it happens to be CCSID 37 which is the
flavor of EBCDIC that's used where I live in the United States -- but I
don't have to hard code that, because *FILE will get it from the file
itself.
STMFCODPAG is the code page of the stream file it's creating. *PCASCII
means that it'll calculate an ASCII code page that's equivalent to the
EBCDIC one that was specified in the preceding parameter. Since I'm
using EBCDIC for the USA in my example, it'll find an ASCII that
supports the same characters.
DTAFMT tells whether the resulting file should be a delimited file
(which is what my example shows) or a fixed file. The difference is
that delimited files have variable-length fields, and each field is
separated from the others by a special character. Software reading the
file will search for this character to know where the field ends, and
the next one begins. By contrast, in a fixed format file, the fields
always start and end in the same positions in the record, so the
software would need to have a list of from/to positions for each field.
Delimited files are more common in data interchange applications
because they're more "self-describing" (i.e. your software doesn't have
to have from/to positions coded into it, it can figure it out from the
data itself)
RCDDLM specifies the special character(s) that denote the end of the
record. *CRLF is the standard on Windows systems, *LF is the standard
on Unix. Old Apple systems used *CR by itself.
STRDLM lets you specify characters that go around each character field.
CSV files typically want double quotes (*DBLQUOTE) but most other file
formats don't use this.
And FLDDLM is the character used (in delimited files) to denote the end
of one field and the start of another. In my example, I used *TAB
because I was making a tab delimited file. For CSV you'd use a comma.
For a fixed-format file, you'd set this to *NONE.
Hope that helps.
As an Amazon Associate we earn from qualifying purchases.