© 2012 Mainframestechhelp.com
Mainframes Tech Help
Help for all Mainframe technical needs
Its our planet.. Go Green
For any Queries/Suggestions/Issues, Send a mail to Support@mainframestechhelp.com
Next
COBOL Tutorial Conti...
DATA DIVISION DATA DIVISION Describes and defines the data items referenced by the program, including their names, lengths, decimal point locations, and storage formats.    This division is optional. The DATA DIVISION has two main sections FILE SECTION describes the data is sent to, or comes from computer peripherals and describes the fields within the records of each file that was using by the program FD/SD filename [RECORD CONTAINS integer CHARACTERS] [BLOCK CONTAINS integer RECORDS] [DATA RECORD IS recordname]. [RECORDING MODE IS {F/V/U/S}]   FD is a File Description level indicator which will describes about the file defined.   SD is a Sort File Description level indicator which will describes about the sort files. RECORD CONTAINS Clause  The RECORD CONTAINS clause describes the size, in characters, of data records in a file.  Because each data record of a file is completely defined in a record description entry, this clause is optional for any file description entry. Syntax: There are three types of RECORD CONTAINS clauses based on the records length: 1) Fixed length: Declaration for fixed length records will be like below RECORD CONTAINS integer CHARACTERS 2) Dynamic length: If the record length will be provided by the runtime, then syntax will be like below. RECORD IS VARYING IN SIZE integer1 to integer2 [DEPENDING ON data-name]. 3) Variable length: If the record length is varying in between fixed lengths then this declaration will be used. RECORD CONTAINS integer1 TO integer2 CHARACTERS. BLOCK CONTAINS Clause  The BLOCK CONTAINS clause used to specify the blocking factor of the file being described and if the actual blocking factor of the file being described cannot be determined by the operating system. Syntax: There are three types of BLOCK CONTAINS clauses based on the records length
If any questions on the above, post your queries on Cobol Discussion forum
Previous Home Forums Tutorials Tools About Us Contact us Login Interview questions