View previous topic :: View next topic
|
Author |
Message |
NIKHIL SHARMA
New User
Joined: 22 Jun 2010 Posts: 12 Location: Bangalore
|
|
|
|
Hi,
I am writing a REXX code which is reading a VB Format file record by record, editing & again writing/updating to the same place.
I cannot read the file into an array as the File is of 50000 records & editing is only required for few hundred records, so I will have to write the whole file again which will take a lot of time.Hence, I am reading & updating record by record.
Now, suppose I have read this record:
<(13,36)>"1234"
its record length is 16. I want to changr it to:
<(13,36)>"12345"
i.e record length 17, but it will write upto 16 characters only & will truncate the last one as shown below:
<(13,36)>"12345
Is there any command through which we can increase the Record Length of that particular record?
Please Suggest... |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Plain and simple answer, you do not process files of 50,000 records with REXX. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
You can't change the length 'in place'. Consider the structure of a VB dataset:
For each block : bytes 1-4 contain the length of the block
within that block, for each record :
bytes 1-4 contain the length of the record.
The 4 bytes following a record contain the length of the next record. If you were able to extend a record, you would overwrite (part of) the length field of the next record and the dataset would be corrupted.
The only way to change the length is to write a new VB dataset.
Garry. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
The only way to change the length is to write a new VB dataset. |
Quote: |
you do not process files of 50,000 records with REXX. |
While creating the new file, suggest you implement using something other than rexx. . . If 50,000 records "hurts" imagine what will happen if the volume dramatically increases. . . |
|
Back to top |
|
|
|