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
 

 

Varibale Length Records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Varibale Length Records
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    Post subject: Re: Varibale Length Records
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    Post subject: Re: Varibale Length Records
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    Post subject: Re: Varibale Length Records
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    Post subject: Re: Varibale Length Records
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    Post subject:
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    Post subject:
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    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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


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