View previous topic :: View next topic
|
Author |
Message |
nagarajan_guru
New User
Joined: 21 Mar 2007 Posts: 6 Location: chennai
|
|
|
|
Hi All,
Is it possible to dynamically change the record length of a sequential file and revert back to the same record length? I can elaborate my question a little bit..
Suppose i create a sequential file with record length 50.Now I want to insert a new field.Now my question is "Is it possible to extend the record length when i want 2 insert a field and switch back to the same record length(ie 50) if i dont want to insert a field?"
Thanks and regards,
Naga. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
If You need this kind of dynamic behavior it would be better to use variable length records
Anyway Yo cannot do that "in place" on datasets with fixed length records
regards
e.s |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
nagarajan_guru wrote: |
"Is it possible to extend the record length when i want 2 insert a field and switch back to the same record length(ie 50) if i dont want to insert a field?" |
Absolutely, no problem, that's what they invented "Variable" record format for. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
As has been posted - yes you can.
Any program that is going to read the file will need to know which record format it has read (often accomplished by using a "record code" that is put in the record).
You might want to post some of your data and how you want things to work for your situation - the "switch back" may present some "opportunities" depending on just how this is defined. If you can show some original records and then what will happen with them, it will be more clear. |
|
Back to top |
|
|
jasorn Warnings : 1 Active User
Joined: 12 Jul 2006 Posts: 191 Location: USA
|
|
|
|
You can also do this kind of thing with fixed width datasets. The shorter records just get a filler. For me, the method I choose depends on the situation. |
|
Back to top |
|
|
|