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 Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm


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