


fp=open(%addr(xml_file): oflag: sflag: 819); <—– No file being created here
What is the value of fp at this point?
// close it; ready to work with now
rc=close(fp);
fp should be non-negative before you can do anything with it. If it's -1, you should get the errno and handle any conditions.
Can you show an example of the value in xml_file? There were some minor changes in open() for i 6.1 that could be affected by the path, though I wouldn't expect it.
If at all possible, you should get rid of o_codepage and use O_CCSID instead. Use a CCSID conversion ID rather than a code page. That should have been done before V5R3, though it also should still work in i 6.1.
What is your QCCSID system value?
Since you a re creating a XML file, you probably also should consider opening it as a text file. Include O_TEXTDATA as one of your oflags. If the file is expected to be readable as text, you should be better off in the long term creating it as text.
Any errno on the creation, the path to the XML file and the system QCCSID value could all lead to some useful answer.
Tom


Was the program compiled for V5R4, or was it an older program that was still used on V5R4 and is now to be used on 6.1? Was it recompiled for 6.1? Modified for 6.1? Is it using the XMLxxx language features? (It probably doesn’t matter, but might lead to other thoughts.)
Please show the open() prototype that you use, any variable definitions for values passed into open(), any operations that set the parm values and the CALLP for open().
Tom
Thanks for your response. The program is still used on V5R4 and now to be used on 6.1 It has been recompiled for 6.1. I also tried modifying the pgm to define the field as varying and use %trim for the filename. Its not using the XMLxxx language features. Here’s a snippet of the code where it fails to create the stram file in IFS:
// create it
oflag = o_creat + o_rdwr + o_trunc + o_codepage;
sflag = S_IWUSR + S_IRUSR + S_IRGRP + S_IROTH;
fp=open(%addr(xml_file): oflag: sflag: 819); <—– No file being created here
// close it; ready to work with now
rc=close(fp);
// attempt to open the file; fp is the open handle number
// text, write, truncate
oflag = o_wronly + o_textdata + o_trunc;
fp=open(%addr(xml_file): oflag); <—– This returns CPE3025
fp was returning -1 (with errno = 3021 [The value specified for the argument is not correct.])
I replaced o_CODEPAGE with o_CCSID and the problem was resolved. I did not add o_TEXTDATA but going to add it now.
Many thanks for your help. I was about to call IBM for help but I’m glad I found this forum first. Would be glad to support this forum with a small donation if I could.
I replaced o_CODEPAGE with o_CCSID and the problem was resolved.
By itself, that usually shouldn’t be enough. Other details, e.g., the path to the XML file, would affect how the change altered results. Different file systems have different capabilities. The way CCSIDs are handled can change somewhat as paths change.
But glad you have it working this far. Make sure that the data is encoded correctly in the file before leaving this issue behind.
Tom