open() API on V6R1

25 pts.
Tags:
AS/400
iSeries
Power6
QC2LE
RPGLE
V6R1
For some reason, my RPGLE program can't create an xml stream file  on the new Power 6 (V6R1). I've tried using %trim(filename) and defining the file name as "varying" length.

It works just fine on V5R4.

I'd appreciate any ideas or suggestions.



Software/Hardware used:
IBM Power 6, V6R1

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • Vijayo
    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
    25 pointsBadges:
    report
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • Vijayo
    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.
    25 pointsBadges:
    report
  • TomLiotta
    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
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following