Rob,

Alan's statement was " What I REALLY WANT to do is to use a command to
make a complete
duplicate of the file to the IFS, as is, as a .TXT file, as if it were
one flat record. Blank-fill is acceptable for the numerics, but...."

That is what I tried to give him. Yes I do it so often I forget about
making it a flat file altogether. I assumed (my mistake) he would
figure that part out.

I do use Scott's API header to read and write directly from the IFS if I
want a programmatic solution. I use C quite a bit so I understand the
apis.

I simply was trying to give him what he asked for.


Sharon

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Wednesday, September 17, 2008 12:04 PM
To: Midrange Systems Technical Discussion
Subject: RE: CPYTOIMPF left-adjusting, blank fill, for zoned first
field,but not the other zoned field

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

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2019 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].