HP3000-L Archives

March 2000, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Russ Smith <[log in to unmask]>
Reply To:
Russ Smith <[log in to unmask]>
Date:
Thu, 23 Mar 2000 14:26:25 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (38 lines)
To my fellow e3k-ers,

I am having a problem with a C program writing data to a KSAM file.  The entire buffer is not being written to the file when the two keys have the same value.  Some background - 

:build KSAM1;dev=disc;disc=75000;rec=-16,,f,ascii;nocctl;ksamxl;key=(B,1,8;B,9,8)

file opened as:
    foption.fs.domain = 1; /* permanent file */
    foption.fs.ascii = 1; /* ASCII */
    foption.fs.designator = 0;
    foption.fs.format = 0;
    foption.fs.carriage = 0;
    foption.fs.label = 0;
    foption.fs.no_f_equ = 0;
    foption.fs.type = 1; /* KSAM file */
    foption.fs.reserved = 0;
    aoption.as.access = 5; /* READ/WRITE (4) */
    aoption.as.multirecord = 0;
    aoption.as.locking = 1;
    aoption.as.exclusive = 3;/* SHARE ACCESS (11) */
    aoption.as.no_buf = 0;
    aoption.as.multi = 0;
    aoption.as.copy = 0;

So, when I issue the following commands:

    sprintf(Buffer,"%8.8s%8.8s",LocatorKey1, LocatorKey2);
    FWRITE(KSAM1FileNo,Buffer,-strlen(Buffer),0);

I get the output record correctly in KSAM1 only IF the values of LocatorKey1 and LocatorKey2 are different.  If the values are the same, the first 8 bytes are written correctly and bytes 9-16 are blank.  I've done a display functions on the output and the EOLN marker appears after byte 8, so the remaining data is not appearing as blank, rather it is never making it into the output file.  An FPRINTF to STDERR shows the data correctly in the Buffer variable BEFORE the FWRITE, but the data just isn't making it to the file.  I'm stumped.  Any thoughts?

Help please.
Rs~

Russ Smith, Systems Consultant
Problem Solved, Vacaville, CA
r s m i t h @ c u - h e l p . c o m

ATOM RSS1 RSS2