I setup a table of tables after I opened sequential files and I
started running into very strange results until I realized that
with sequential files, you can't really distribute FCB the same
way, as the offset pointer is stored in that FCB. You have to
save it back to the table when your done with it, and you can't
distribute it more than 1 process at a time, at least for writing
(but that's kind of a gimmie for sequentials on writing)
What I was doing was passing the FCB to a subroutine after reading
it from the master table of opened files, and that subroutine
would write to the seqential file.
What I found I had to do was when the subroutine completed, It had
to pass back and I had to write the FCB back to the table of tables,
so it had an updated offset pointer, otherwise, the next time
I passed off that FCB, it would overwrite.
How can you use this to your advantage?
If your writing a sequential file, you can save your FCB into
a variable before you execute a block of code, if your block
of code does some writing to the sequential file, but you get
to the end of the code, and you hit something that makes it so
this line (or anything after you saved the FCB) shouldn't have
been written, all you have to do is restore your FCB from the
variable you saved it to - and your file offset pointer will
be reset to where it was before the block of code.
> -----Original Message-----
> From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
> boun...@listserver.u2ug.org] On Behalf Of Symeon Breen
> Sent: Thursday, July 14, 2011 10:15 AM
> To: 'U2 Users List'
> Subject: Re: [U2] Record Locks - How long should they last for?
> The function FFileOperation will lookup the file in a table of tables
> as it
> where and determine if it is a csv, xml, sql or u2 file ( that table
> includes the EXT, filename, SQL command etc to use for acces) and then
> the correct procedure to read/write - a chunk of code in there so i
> include it in here, but it does mean all reads and writes go through
> one piece of code...
U2-Users mailing list