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

Handle the variable length records


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

New User


Joined: 19 Apr 2005
Posts: 26

PostPosted: Tue Jun 27, 2006 1:01 pm
Reply with quote

Hi all,

Can I know how to handle the variable length records using cobol and jcl.


Thanks in advance,
Sripriya.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Tue Jun 27, 2006 2:59 pm
Reply with quote

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
View user's profile Send private message
hemanta

New User


Joined: 09 May 2006
Posts: 5

PostPosted: Thu Jun 29, 2006 2:28 pm
Reply with quote

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
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 0
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