Hey Peter,
I am able to write to the z/OS dataset when using fopen() and fwrite() directly, e.g.:
FILE *stream = fopen("//‘USERBTC.OUTPUT.FILE’",“wb, lrecl=105”);
fwrite(record,sizeof(char),105,stream);
I am using z/OS 2.2 and OS390:Stdio 0.008, which I believe is the lateset version, and I do have Perl 5.8.6 installed as the standard Perl on the system, but I was using Perl 5.00503 by pointing to it directly.
I should have given you the full error message for the SOC4, it says:
The system detected a protection exception (System Completion Code=0C4).
From entry point PerlIO_findFILE at compile unit offset +00000076 at entry offset +00000076 at address 122B623E
I saw in the source code for mvsopen http://cpansearch.perl.org/src/PVHP/OS390-Stdio-0.008/Stdio.xs that it executes differently depending on whether the USE_PERLIO macro is defined. The difference is that when USE_PERLIO is defined:
pio_fp = PerlIO_importFILE(fp,mode);
is executed.
In my PERLLIB for 5.00503, PerlIO.pm and PerlIO/ are not present, but in my PERLLIB for 5.8.6 and 5.22.0 they are, so I’m guessing that USE_PERLIO is not defined in the 5.00503 installation, but is for 5.8.6 and 5.22.0.
I am only able to write to z/OS datasets with 5.00503.
So I would guess that there is some problem with PerlIO_importFILE(), or how OS390::Stdio mvsopen uses it that is causing this issue. Do you think this is correct?
Thanks for your help,
Brandon