I figured it out a few minutes after my original posting.
the fopen should look like:
CALL INTRINSIC "FOPEN" USING WS-HOLD-FILE-NAME,
\%14004\
\%305\
WS-REC-SIZE
\\
WS-KSAMXL-PARAM
\\ \\ \\
WS-NEW-FLIMIT
GIVING WS-FILE-NUM-OUT
END-CALL.
Thanks,
Brian.
On Fri, 12 Nov 2004 12:33:22 -0500, Brian Donaldson <[log in to unmask]>
wrote:
>Maybe another pair of eyes will see what I am doing wrong. I hope so :-)
>
>
>Scenario:
>
>#1 FOPEN KSAMXL file for input. Works fine.
>Then I do FGETKEYINFO. Apparently works fine. No error.
>
>#2 FOPEN a temporary file with the KSAMXL key attributes from the
>#1 FOPEN. Try to #2 FOPEN with an FLIMIT of twice the size of the
>flimit from #1 FOPEN. Well, it isn't working correctly. The flimit is zero.
>
>I know it is programmer brain damage but I just can't see what I am
>doing wrong.
>
>Help! The code is:
>
> CALL INTRINSIC "FOPEN" USING LS-FILE-NAME,
> \%5\ \%0\, \WS-REC-SIZE\
> GIVING WS-FILE-NUM-IN
> END-CALL.
> IF C-C NOT = ZEROES THEN
> CALL INTRINSIC "FCHECK" USING WS-FILE-NUM-IN,
> LS-ERROR-CODE,
> \\ \\ \\
> END-CALL
> MOVE 244 TO LS-MSGNUM
> GO TO A100-EXIT
> END-IF.
> CALL INTRINSIC "FGETKEYINFO" USING WS-FILE-NUM-IN,
> WS-KSAMXL-PARAM,
> WS-KSAMXL-CONTROL
> END-CALL.
> IF C-C NOT = ZEROES THEN
> MOVE 245 TO LS-MSGNUM
> GO TO A100-EXIT
> END-IF.
> MOVE 50000 TO WS-NEW-FLIMIT.
> CALL INTRINSIC "FOPEN" USING WS-HOLD-FILE-NAME,
> \%4\
> \%305\
> WS-REC-SIZE
> \\
> WS-KSAMXL-PARAM
> \\ \\
> WS-NEW-FLIMIT
> GIVING WS-FILE-NUM-OUT
> END-CALL.
> IF C-C NOT = ZEROES THEN
> CALL INTRINSIC "FCHECK" USING WS-FILE-NUM-OUT,
> LS-ERROR-CODE,
> \\ \\ \\
> END-CALL
> CALL INTRINSIC "FCLOSE" USING WS-FILE-NUM-IN,
> \0\ \0\
> END-CALL
> CALL INTRINSIC "FCLOSE" USING WS-FILE-NUM-OUT,
> \0\ \0\
> END-CALL
> MOVE 246 TO LS-MSGNUM
> GO TO A100-EXIT
> END-IF.
>
>
>Further down I do an FWRITE to the file opened by #2 FOPEN. The FWRITE
>fails with error code zero. When I look further into it, I see
>the FLIMIT on the output file is zero(!)...
>
>TIA,
>
>Brian Donaldson.
>
>* To join/leave the list, search archives, change list settings, *
>* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|