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

Changing the Record Length of a record in File of VB Format


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
NIKHIL SHARMA

New User


Joined: 22 Jun 2010
Posts: 12
Location: Bangalore

PostPosted: Thu Dec 16, 2010 11:30 am
Reply with quote

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

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Thu Dec 16, 2010 3:31 pm
Reply with quote

Plain and simple answer, you do not process files of 50,000 records with REXX.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Dec 16, 2010 3:34 pm
Reply with quote

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

Moderator Emeritus


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

PostPosted: Thu Dec 16, 2010 9:15 pm
Reply with quote

Hello,

Quote:
Please Suggest...

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
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
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
Search our Forums:

Back to Top