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 Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Length of Tape file Mohan Kothakota JCL & VSAM 9 Thu Apr 20, 2017 10:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us