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
 

 

Handle the variable length records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Handle the variable length records
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: 1187
Location: Bangalore,India

PostPosted: Tue Jun 27, 2006 2:59 pm    Post subject:
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    Post subject:
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    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