|
I've been working with this command lately. Maybe I can help. The first to know is that although the CPYTOIMPF will create a stream file, the stream file will have the same code page as the database file and so the contents will be EBCDIC. If the stream file already exists and has a PC ASCII code page, the CPYTOIMPF will convert the EBCDIC to ASCII and convert pack decimals to ASCII numbers. You can create this stream file with your PC using Client Access or some other utility.
You can also create the stream file with the correct code page on the 400 with the CPYTOSTMF command by setting the command parm STMFCODPAG to *PCASCII. Use the CPYTOSTMF command to copy a source physical file to a stream file like this:
CPYTOSTMF FROMMBR('/qsys.lib/qgpl.lib/qclsrc.file/member.mbr')
TOSTMF('/qdls/yourflr/yourfil.txt') STMFCODPAG(*PCASCII)The file names have to be in IFS format. CPYTOSTMF will work with program described files and externally defined files with no more that three fields, but I find that source files work best. Use any source file you want, since its contents will overridden by the CPYTOIMPF command.
These 2 examples of the CPYTOIMPF command has worked for me:
CPYTOIMPF FROMFILE(YOURLIB/YOURFILE YOURMEMBER) TOSTMF('/qdls/yourflr/yourfil.txt')
MBROPT(*REPLACE) RCDDLM(*CRLF) DTAFMT(*FIXED)
or
CPYTOIMPF FROMFILE(YOURLIB/YOURFILE YOURMEMBER) TOSTMF('/qdls/yourflr/yourfil.txt')
MBROPT(*REPLACE) RCDDLM(*CRLF) DTAFMT(*DLM) STRDLM('"') FLDDLM(X'05')The X'05' in the second example creates a TAB delimited file. On the command prompt the FLDDLM parameter is only 3 characters long. Use the ampersand (&) to expand the field so you can enter the hexidecimal X'05'. There is a *TAB value for this parameter but it doesn't work. Maybe there is a PTF for it somewhere.
I hope this helps.
Guy Murphy - FACTS system
University of Illinois
217-333-8670
-----Original Message-----
From: John Bussert [mailto:jbussert@stecnet.com]
Sent: Wednesday, May 12, 1999 9:36 AM
To: MIDRANGE-L (E-mail)
Subject: CPYTOIMPF question
When using the copy to import file command, the to stream file, how is that
formatted and where does it exist. I am trying to copy a file to a folder,
but it fails on the creation of the to file becuase ??? (of course the
message does not tell me why).Has anyone used this or the CPYTOSTMF command that has the same to parm??
Thanks
Just as an aside - does anyone like the book manager?? It is the worst peice
of software I have ever seen - give me printed manuals....... Where is the
CL programmers reference manual??? Sorry for the rant ;-)john
John Bussert
jbussert@stecnet.com
Swift Technologies, Inc.
847-289-8339
847-289-8939 fax+---
| 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 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.