Assigning File Length

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
Rajapriyaa
Member
Posts: 12
Joined: Fri Apr 17, 2009 11:22 am

Assigning File Length

Post by Rajapriyaa » Thu Jul 30, 2009 12:34 pm

Hi..
Can we Assign the file length for the input files dynamically. For example, i have only one program and i need to execute that with 10 different i/p files with VB record format and the o/p file length is same. So can we do this with only one DD name for i/p files?

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

COBOL VB FILE SECTION RECORDING MODE

Post by Natarajan » Thu Jul 30, 2009 12:48 pm

You can do that. but you need to code cobol program accordingly.
Modify FILE SECTION with correct parameters.

Code: Select all

 FILE SECTION.
  FD  FILE-1
      RECORDING MODE IS V
      RECORD IS VARYING FROM 40 TO 60 CHARACTERS.
  01  REC-PART-1           PIC X(40).
  01  REC-PART-2           PIC X(15).
Natarajan
Chennai

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Thu Jul 30, 2009 2:36 pm

Why do you think you need to assign the length of files dynamically? Unless I'm mistaken it's a question about handling of VB-files in COBOL, isn't it?
Regards,
Anuj

Rajapriyaa
Member
Posts: 12
Joined: Fri Apr 17, 2009 11:22 am

Post by Rajapriyaa » Thu Jul 30, 2009 4:11 pm

Nataraj,
Thanks for the reply.. But I guess that code will work for the record length variation and not for the file Length.
Anuj,
I can process the 10 i/p VB files by assigning 10 DD names which have different length. But i want to process it by assigning to one DD. Thats why i want to assign the length of the files dynamically.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others