Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Dynamically change the record length of a sequential file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Dynamically change the record length of a sequential file
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10234
Location: italy

PostPosted: Thu Apr 26, 2007 4:55 pm    Post subject: Re: IS IT POSSIBLE TO CHANGE THE RECORD LENGTH OF A SEQ FILE
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: 3158
Location: Tucson AZ

PostPosted: Thu Apr 26, 2007 5:28 pm    Post subject: Re: IS IT POSSIBLE TO CHANGE THE RECORD LENGTH OF A SEQ FILE
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

Site Director


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

PostPosted: Thu Apr 26, 2007 10:12 pm    Post subject:
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

Active User


Joined: 12 Jul 2006
Posts: 153
Location: USA

PostPosted: Wed May 09, 2007 7:17 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us