Re: CPYFRMIMPF and internal end-of-line markers
- From: CRPence <crpence@xxxxxxxxxxxx>
- Date: Thu, 23 Aug 2007 17:49:59 -0500
One of the enhancements to the database import feature for V5R3M0 enables the embedded carriage controls irrespective of the match to the line end [aka record delimiter].
Issuing the following SQL, import request, and ad hoc query request, the resulting sample report was given:
create table crlf (i smallint, n char(20), a char(20), d date)
CPYFRMIMPF FROMSTMF('/tmp/crlf.txt') TOFILE(*curlib/CRLF *FIRST)
MBROPT(*REPLACE) FROMCCSID(*FILE) RCDDLM(*CRLF) DTAFMT(*DLM)
STRDLM('"') FLDDLM(',') DECPNT(*PERIOD) DATFMT(*ISO) TIMFMT(*ISO)
FROMRCD(1 *END) ERRLVL(*NOMAX) ERRRCDFILE(*NONE) RPLNULLVAL(*NO)
RUNQRY *NONE *curlib/CRLF
Line ....+....1....+....2. | 3....+....4....+....5....+....6..
I N | A D
000001 1 Bob Smith | 123 Main Street 2007-01-25
000002 2 Frank Jones | 456 Elm St Apt 25 2007-03-18
000003 3 Mary Otonashi | Clock Hill 2-6-5 -
****** ******** End of report ********
Note: the 0x25 is a control character in the 5250 data stream, so the characters to its right will appear underlined reverse video in the sample report.
Note: If there is a *DTAARA object name QCPFRMIMPF in the *LIBL, that would have to be deleted; as it probably exists in order to effect output using the V5R2M0 algorithm.
Regards, Chuck
--
All comments provided "as is" with no warranties of any kind whatsoever and may not represent positions, strategies, nor views of my employer
Peter H. Coffin wrote:
Is there any magic way of making CPYFRMIMPF respect column delimiters.
with regard to end-of-line markers? As an example, with RCDDLM(*CRLF):
1,"Bob Smith","123 Main Street","2007-01-25"
2,"Frank Jones","456 Elm St
Apt 25", "2007-03-18"
3,"Mary Otonashi","Clock Hill 2-6-5"
Record two, field three should (IMHO) end up containing '456 Elm St' + x'0D25' + 'Apt 25'
instead of rejecting the records as being errors.
- References:
- CPYFRMIMPF and internal end-of-line markers
- From: Peter H. Coffin
- CPYFRMIMPF and internal end-of-line markers
- Prev by Date: CPYFRMIMPF and internal end-of-line markers
- Next by Date: AS/400 Analyst programmer looking for a new job.
- Previous by thread: CPYFRMIMPF and internal end-of-line markers
- Next by thread: AS/400 Analyst programmer looking for a new job.
- Index(es):