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.?
VARIABLE FILE IN COBOL
Moderator: Moderator Group
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 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)
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.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
IMHO, the 2 main reasons to use Variable Length records is to save space and improve performance.
As DBZ suggests, you need to do a lot of research before going for another similar interview.
I know of no rule for this. The various records lengths in a Variable Length file tend to define themself by content. . .how would you set the variable record length
As DBZ suggests, you need to do a lot of research before going for another similar interview.
Have a good one
VARIABLE FILE IN COBOL
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.
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.
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
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page