View previous topic :: View next topic
|
Author |
Message |
Mutthu_talluri
New User
Joined: 16 Jun 2005 Posts: 9
|
|
|
|
Hi All,
How can we declare Variable Length Records in File Section? |
|
Back to top |
|
|
sangiah
New User
Joined: 10 Jun 2005 Posts: 62
|
|
|
|
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 |
|
|
sudheer648
New User
Joined: 23 May 2005 Posts: 97 Location: Chennai
|
|
|
|
Hi Mutthu_talluri,
As far my KB their is a concept of RD thru which we define the variable length records. |
|
Back to top |
|
|
Sangita
New User
Joined: 02 Jun 2005 Posts: 17
|
|
|
|
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 |
|
|
sudheer648
New User
Joined: 23 May 2005 Posts: 97 Location: Chennai
|
|
|
|
Hi,
Quote: |
FD TransFile
RECORD IS VARYING IN SIZE
FROM 8 TO 31 CHARACTERS. |
use this. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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 |
|
|
Mutthu_talluri
New User
Joined: 16 Jun 2005 Posts: 9
|
|
|
|
How can we declare the VB structure in File Section?
Can any one give me the one example code... |
|
Back to top |
|
|
|