IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Dynamically change the record length of a sequential file


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nagarajan_guru

New User


Joined: 21 Mar 2007
Posts: 6
Location: chennai

PostPosted: Thu Apr 26, 2007 4:50 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Apr 26, 2007 4:55 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Apr 26, 2007 5:28 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Apr 26, 2007 10:12 pm
Reply with quote

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
View user's profile Send private message
jasorn
Warnings : 1

Active User


Joined: 12 Jul 2006
Posts: 191
Location: USA

PostPosted: Wed May 09, 2007 7:17 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
Search our Forums:

Back to Top