VARIABLE FILE IN COBOL

cobol interview questions

Moderator: Moderator Group

Post Reply
srini1508
Member
Posts: 14
Joined: Fri Sep 30, 2011 4:37 pm

VARIABLE FILE IN COBOL

Post by srini1508 » Tue Oct 11, 2011 4:03 pm

Hi,

I faced a interview question as below

how would you set the variable record length and what is the use of defining file as variable length format.

can any one please reply me what is the gud way to answer to this question.?

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Tue Oct 11, 2011 4:08 pm

i would invest some time either reading any of the COBOL Application programmers guides,
or even google COBOL tutorials.

a quick google search for 'why use variable length records'
returned About 6,150,000 results (0.07 seconds)
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

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

Post by Anuj Dhawan » Sat Oct 15, 2011 4:09 pm

And if it's an interview question then it should have been in appropriate Forum, is not it?
Regards,
Anuj

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Sun Oct 16, 2011 8:25 am

IMHO, the 2 main reasons to use Variable Length records is to save space and improve performance.
how would you set the variable record length
I know of no rule for this. The various records lengths in a Variable Length file tend to define themself by content. . .

As DBZ suggests, you need to do a lot of research before going for another similar interview.
Have a good one

academyindia4

Topic deleted by Admin

Post by academyindia4 » Thu Jan 21, 2016 12:19 pm

<< Content deleted By Admin >>

shipra
Member
Posts: 1
Joined: Wed Oct 05, 2016 10:28 am

VARIABLE FILE IN COBOL

Post by shipra » Wed Oct 05, 2016 10:47 am

In transaction files of banks for eg has a header record,detail records,trailer record.So 3 different kind of records of variable length are there.In such cases comes the use of defining file as variable length format.

SYNTAX:

FD INFILE
RECORD VARYING FROM 1 TO 2795 CHARACTERS
RECORDING MODE IS V.

01 INFILE-REC.
03 FILLER PIC X OCCURS 1 TO 2795 TIMES DEPENDING ON WS-REC-SIZE.

here 2795 is the size of largest record in that file.

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