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

Varibale Length Records


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

New User


Joined: 16 Jun 2005
Posts: 9

PostPosted: Thu Jun 16, 2005 3:54 pm
Reply with quote

Hi All,

How can we declare Variable Length Records in File Section?
Back to top
View user's profile Send private message
sangiah

New User


Joined: 10 Jun 2005
Posts: 62

PostPosted: Thu Jun 16, 2005 3:58 pm
Reply with quote

01 level with maximum record length
01 level with minimum record length

suppose if my maximum record length is 2500 and minimum record length is 1000

then

01 record-a pic x(2500).
01 record-b pic x(1000).

Correct me if I am wrong.
Back to top
View user's profile Send private message
sudheer648

New User


Joined: 23 May 2005
Posts: 97
Location: Chennai

PostPosted: Thu Jun 16, 2005 4:34 pm
Reply with quote

Hi Mutthu_talluri,

As far my KB their is a concept of RD thru which we define the variable length records.
Back to top
View user's profile Send private message
Sangita

New User


Joined: 02 Jun 2005
Posts: 17

PostPosted: Thu Jun 16, 2005 5:03 pm
Reply with quote

Hi,

In FILE SECTION we can give RECORDING MODE IS V/VB
and specify the variable length .

DATA DIVISION.
FILE SECTION.
FD FILE1
RECORD CONTAINS 40 TO 80 CHARACTERS
RECORDING MODE IS V/VB

When we give record contains integer-1 to integer-2 characters
it automatically means variable record length.

Please correct me if I am wrong.

Regards,
Sangita
Back to top
View user's profile Send private message
sudheer648

New User


Joined: 23 May 2005
Posts: 97
Location: Chennai

PostPosted: Thu Jun 16, 2005 5:20 pm
Reply with quote

Hi,

Quote:
FD TransFile
RECORD IS VARYING IN SIZE
FROM 8 TO 31 CHARACTERS.


use this.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Jun 17, 2005 6:43 am
Reply with quote

Sangiah's method can work but each rec has to have an id field so you can match the description to each rec that is read.

A better method is to include the following in the FD:

RECORD VARYING FROM x TO y DEPENDING ON WS-LEN

WS-LEN is defined in WS as PIC 9(5).

After each rec is read WS-Len will contain its length. If you want to write a V/VB rec make sure WS-LEN contains the desired len before issuing the WRITE. You can use the len from the READ if it's appropriate to your situation.
Back to top
View user's profile Send private message
Mutthu_talluri

New User


Joined: 16 Jun 2005
Posts: 9

PostPosted: Thu Jun 23, 2005 11:39 am
Reply with quote

How can we declare the VB structure in File Section?

Can any one give me the one example code...
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
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