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

length of records in a variable file.


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

New User


Joined: 30 Jun 2007
Posts: 39
Location: India

PostPosted: Sat Oct 31, 2009 2:56 pm
Reply with quote

Hi,

I have a file of Variable block attribute. It is having an average record length of 80 and maximum record length of 120. Now I need to find out the length of each record of the file. It can be wither with COBOL programing or JCL. Can some one let me know the what will be the logic for COBOL programming and if the solution can be obtained from jcl then how to proceed.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Oct 31, 2009 4:13 pm
Reply with quote

expat says it more succinctly and politely than i would:
/RANT ON
Once more let us clarify exactly what JCL is.

it is Job Control Language.

By itself it does nothing. It is used to invoke the chosen program and to define which datasets are to be used by the DD names associated with the chosen program.

JCL does not have magical powers that solve all problems, JCL is merely the vehicule for telling the processor which program you want it to execute.
/RANT OFF

Look in the COBOL Application Programmers guide and the COBOL Language Reference for the syntax to obtain the record length during a READ operation.

Search the DFSORT forum (unless of course you have syncsort),
many discussions on how to determine the RDW of a record.

Also, one of the first sticky's in the DFSORT forum is a reference to manuals. Look at the getting started or quickstart manual. I believe the necessary control cards are explained.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Oct 31, 2009 5:57 pm
Reply with quote

COBOL has a RECORD VARYING clause in the FD that allows you to specify a variable; this variable is set to the length of each record when it is read. If the file is an output file, you must set the length of the data to be written in this variable before doing the WRITE.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Nov 02, 2009 3:31 pm
Reply with quote

As Dick has said, have a look on this thread: www.ibmmainframes.com/viewtopic.php?t=41779&highlight=rdw
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(F1 & F2) and writ... JCL & VSAM 4
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top