View previous topic :: View next topic
|
Author |
Message |
andy6703
New User
Joined: 25 Jul 2005 Posts: 14
|
|
|
|
Hi,
What does it mean when we code LABEL RECORDS ARE STANDARD in the File section. Please do give a thorough basic explanation as I want to understand the concept clearly.
Thanks & Regards,
Anuradha. |
|
Back to top |
|
|
shivashunmugam Muthu
Active User
Joined: 22 Jul 2005 Posts: 114 Location: Chennai
|
|
|
|
Label records are usually created as the first and last records of a disk or tape to provide identifying information about the file on disk or tape. Labels are created on output files so that, when the same file is later read as input, the labels may be checked to ensure that the file being accessed is the correct one. Labels are created on output files and checked on input files. The COBOL compiler will supply the routine for writing labels on output files or for checking labels on input file if the entry LABEL RECORDS ARE STANDARD is included.
This LABEL RECORDS clause will result in the following :
1. For output files, the first record on disk or tape file will be created as a standard 80-position header label identifying the file to the system; similarly, the last record on the disk or tape will be created as a trailer label.
2. For input files, these labels will be computer-checked to ensure that the file being processed is the correct one.
The clause LABEL RECORDS ARE STANDARD is permitted for disk and tape files only. Devices such as printers do not use label records, since identifying information is unnecessary where data is visible to the human eye. The clause LABEL RECORDS ARE OMITTED is used for such files.
For VSAM files this clause is syntex checked but it has no effect in execution |
|
Back to top |
|
|
andy6703
New User
Joined: 25 Jul 2005 Posts: 14
|
|
|
|
Hi shivashunmugam Muthu,
Thanks for such a detailed explanation. Why do we need additional identifying info about a file when filename itself acts as an important identification?
Regards,
Anuradha. |
|
Back to top |
|
|
SHIVAREDDY
New User
Joined: 25 Jul 2005 Posts: 20
|
|
|
|
Hi andy,
I think below explanation is more than enough to understand the statement.For this first u need to know why label records statement is used and then learning standard option is childs play.Go thru the below info.
LABEL RECORD(S) Clause -
Data is stored on disk as magnetized bits or binary digits that cannot be seen by the nak*** eye. Label records, then, are usually created as the first and last records of a disk file to provide identifying information about the file. Since the data on a disk is not visible, these label records can be used to check if the correct file is being accessed for a specific program.
FORMAT
LABEL {RECORD IS} {RECORDS ARE} {OMITTED} {STANDARD}
This LABEL RECORDS clause will result in the following:
1. For output files, the first record on a disk file will be created as a standard 80-position header label identifying the file to the system; similarly, the last record on the disk will be created as a trailer label.
2. For input files, these labels will be computer-checked to ensure that the file being processed is the correct one.
LABEL RECORDS ARE STANDARD
This clause is permitted only for magnetic media such as disk.
LABEL RECORDS ARE OMITTED
This clause is used for printed files since they do not use label records.
Sometimes a disk file may also not have any labels and thus the LABEL RECORDS ARE OMITTED clause would be used.
Send query again if u dont understand clearly.bye. |
|
Back to top |
|
|
shivashunmugam Muthu
Active User
Joined: 22 Jul 2005 Posts: 114 Location: Chennai
|
|
|
|
Hi Anuradha,
Please dont confuse it with mere identification purpose. As per the above reply you shd hav got some fair idea. And one more thing, this clause was mandatory only for COBOL 74. Further in COBOL 85, this was made it as optional.
Purpose is to reduce the FD entries as possible as could. Compare JCL 'LABEL' parameter with this context. You could understand what is the purpose is all about.
Hope you clear now.
Thanks
Shiva |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Andy,
Using the more recent compilers as noted by Shiva the LABELS clause is treated as comments.
With earlier compilers the clause was used more for describing the attributes the file than identifying it. |
|
Back to top |
|
|
|