Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
This topic is locked: you cannot edit posts or make replies. Selecting two copybooks of different ... Vignesh Sid COBOL Programming 8 Tue Sep 05, 2017 7:28 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us