× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Sharon,

Cause . . . . . : Object /QSYS.LIB/QTEMP.LIB/SHARON.FILE/SHARON.MBR must
be
either a source physical file that has three fields or a program
described
file. Externally described files and source physical files containing
fewer
or more than three fields are not permitted by this command.

I avoid CPYTOIMPF and CPYFRMIMPF like the plague since V5R3.
I recommend one of two things:

1 - Create a second table that is one big field. No DDS or DDL. CRTPF
FILE(QTEMP/SHARON2) RCDLEN(...)
CPYF FROMFILE(QTEMP/SHARON)
TOFILE(QTEMP/SHARON2)
MBROPT(*REPLACE)
FMTOPT(*NOCHK)
Then use CPYTOSTMF on that.
CPYTOSTMF FROMMBR('/qsys.lib/qtemp.lib/sharon2.file/sharon2.mbr')
TOSTMF('/rob/sharon.txt')
STMFCODPAG(*PCASCII)

2 - Use Scott Klement's APIs to write to the IFS directly.

Full run through of first method.

CREATE TABLE QTEMP.SHARON (MYDEC NUMERIC ( 15, 2), MYCHAR CHAR ( 5))
INSERT INTO QTEMP.SHARON VALUES(1.22, 'A')
DSPPFM FILE(QTEMP/SHARON)
*...+....1....+.
000000000000122A
CRTPF FILE(QTEMP/SHARON2) RCDLEN(20)
CPYF FROMFILE(QTEMP/SHARON)
TOFILE(QTEMP/SHARON2)
MBROPT(*REPLACE)
FMTOPT(*NOCHK)
CPYTOSTMF FROMMBR('/qsys.lib/qtemp.lib/sharon2.file/sharon2.mbr')
TOSTMF('/rob/sharon.txt')
STMFCODPAG(*PCASCII)
DSPF STMF('/rob/sharon.txt')
....+....1....+.
000000000000122A

Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.