[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Modify record in flat file



Bruce,
    From past experience, the only way that I have been able to do something
similar to what you are trying to achieve is as follows :
 
1. Write out all the data records to a temporary file while accumulating the
necessary buckets, say, total number of records,
2. Close the temporary file,
3. Open a new file and write the header row as necessary using the various
buckets that you computed and
4. Read the data records from the temporary file and write it as is, to the
new file. 
 
When you are done, you will have achieved what you wanted. 
 
Hope this helps. 

Sincerely, 
Krishnan 

Ruan Transportation Management Systems 
(515) 245-5655 [P] 
(515) 247-2284 [F] 
ksaranga@ruan.com <mailto:ksaranga@ruan.com>  

 

-----Original Message-----
From: Bruce Weinstein [mailto:bruceweinstein@CANADA.COM]
Sent: Tuesday, August 24, 1999 2:03 PM
To: Multiple recipients of list SQR-USERS
Subject: Modify record in flat file


I have a SQR that writes to a flat file.  Problem is the first record in the
file is supposed to be a header record containing general info.  One item it
is to contain is the number of records in the flat file.  I do not know this
value until the very end of running this SQR.  What I need to be able to do
is create my flat file with the header record as row 1, then when the SQR
has finished writing to the file, go back and update  the header record with
the number of records in the file.  My question is can I go back and update
the header row (Row 1) after writing all the records to the file first?
 
Your help would be appreciated.
 
Bruce Weinstein
E-mail: bruceweinstein@canada.com