View previous topic :: View next topic
|
Author |
Message |
sripriya
New User
Joined: 19 Apr 2005 Posts: 26
|
|
|
|
Hi all,
Can I know how to handle the variable length records using cobol and jcl.
Thanks in advance,
Sripriya. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
In cobol declare first 4 byte as s9(4) comp-3.
Suppose variable record max length is 136.
So declare it in COBOL
01 ws-file-a.
02 file-len s9(4) comp-3.
02 file-rec x(136).
In Jcl
record length :140
format :vb |
|
Back to top |
|
|
hemanta
New User
Joined: 09 May 2006 Posts: 5
|
|
|
|
Hi This is a description of declaring a file having variable length records
Here my file CHNGCTRL can have records starting from 1 byte to 600 bytes.
FD CHNGCTRL
LABEL RECORDS ARE OMITTED
RECORDING MODE IS V
BLOCK CONTAINS 0 RECORDS
RECORD IS VARYING FROM 1 TO 596
DEPENDING ON N1-CHAR.
01 INPUT-RECORD
05 FILLER OCCURS 1 TO 596 DEPENDING ON N1-CHAR PIC X(01).
WHERE N1-CHAR IS DECLARED IN WORKING STORAGE LIKE THIS
01 N1-CHAR PIC 9(4) COMP. |
|
Back to top |
|
|
|