×
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.
On 2017-08-11 5:47 PM, James H. H. Lampert wrote:
DAMN, these things are counterintuitive.
Added an O_CCSID to the OFlags (and the necessary other fields)
(whitespace columns squeezed to fit):
D OFLG S 10I 0 INZ(16777249) 1+32+16777216
* (O_RDONLY + O_CCSID + O_TEXTDATA)
D MODE S 10I 0 INZ(0)
D CCSID S 10I 0 INZ(37)
and then changed the open to:
C EVAL FD = OPEN(%TRIM(PATH):OFLG:MODE:CCSID)
and it worked right off. Even though I was specifying MY CCSID, rather
than the FILE's CCSID.
The doc for the open() API says this for the scenario where an existing
file is opened and O_TEXTDATA is specified: "If O_CCSID is not
specified, and the file CCSID and open CCSID are not the same, and one
of them is not strictly single-byte, open() will fail with errno set to
[ECONVERT]."
Since the file CCSID (1208) and the open CCSID (your job CCSID) are not
the same, and 1208 is not strictly single byte, it fails with ECONVERT.
When you changed to specify O_CCSID and specified the open-ccsid
parameter, the API was fine with the CCSID difference.
(I don't know why it would have worked before, unless the file CCSIDs
weren't always 1208. I always specify all four parameters, so I never
noticed this issue before.)
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_72/apis/open.htm;
see the last bullet in the "When an existing file is opened and
O_TEXTDATA is specified" section.
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.