Moved the below Read component to the duplicate guide and added an IF situation to check out the for the not finish of document status as below.Please take note that the File-status right here is nothing at all but the END-OF-FILE.
Cobol Read File Code You SubmittedIn the unique code you submitted, PERFORM READ-FlLE UNTIL END-0F-FILE will check A to be 2 or 3 and perform appropriate program code each period a record is go through.Your revised reasoning will test A to become 2 or 3 only after the finish of document is reached (or VALID-FILE is definitely arranged, whatever that is certainly), not really for each report.Like a spin may require anything from modifying a several statements to a total spinning of the program code depending upon the reasoning. You need to go to whoever gave you the task, clarify the issue, and discover out if you should attempt to reword the program code or take that making use of a duplicate reserve for file operations in that system will not function. Structure 3: Saving MODE Is usually U We make use of this when the file does not have fixed as properly as adjustable record length and the records have unknown record length. Each record are divided into areas which consists of the details about information. COBOL supports 3 sorts of documents Sequential Document Indexed Document Relative company Document SEQUENTIAL FILE Lets find some important features of Sequential data files- We also call Sequential Data files as Level file The records are saved in a sequential way one after the some other. To access the Nth record, we have got to read through very first (N-1) information first. It is suggested to make use of the sequential file if the basic file learn and write is certainly required and now there are usually the much less frequent research of a random and dynamic accessing of report is needed. The Syntax of Sequential document SELECT L0GICAL-FL ASSIGNED T0 PHYSICAL Florida ORGANIZATION Is usually SEQUENTIAL. This we program code in the FlLE-CONTROL under lNPUT-OUTPUT Area which is certainly described under ENVIRONMENT DIVISION. Trial COBOL Plan to show how the file is described in INPUT-OUTPUT Section TutorialBrain-How Data files are defined in FILE-CONTROL. Lets grasp FD Clause- FD appears for File Explanation which represents the design of all the documents which are utilized in the plan. FD must become defined inside the Document SECTION of the DATA DIVISION. FILE SECTION. FD FILE-NAME. RECORD CONTAINS N characters Block out CONTAINS I Files DATA Report IS RECORD-DET Saving MODE Is definitely FVU. LOGICAL-FL-REC. 05 VAR-1 Picture 05 VAR-2 PIC.. Right here, the below sentences are various Report CONTAINS In charactersBLOCK CONTAINS I RECORDSDATA Report IS RECORD-DETRECORDING Setting Is certainly FVU. LOGICAL-FL-REC. 05 VAR-1 PIC 9(2). VAR-2 Photo Times(10). Right here the title LOGICAL-FL-REC is dependent from system to system. Centered on the requirement, you can alter this name. ![]() Information CONTAINS In CHARACTERS RECORD CONTAINS details the size of information Record. ![]() Format 3: Report IS Differing IN Dimension N-1 TO D-2 DEPENDING ON DATA-ITEM-NAME We can define like Structure 3 Active files. DATA Report Is usually RECORD-DET Information RECORD provides the report details of the data name. Block out CONTAINS I Files Block out CONTAINS we make use of to define the block out size of the document. Structure 1: Engine block CONTAINS 80 CHARACTERS We can specify like File format 1 for set length documents Structure 2: Stop CONTAINS N-1 TO D-2 Character types We can determine like Structure 2 for variable files. File format 3: Mass CONTAINS Dimension IN In-1 TO In-2 Personas DEPENDING 0N DATA-lTEM-NAME We cán establish like Structure 3 Dynamic files. There is certainly a exclusive Block out CONTAINS and thé syntax fór this is- Mass CONTAINS 0 Character types In some organizations, programmers program code like this fór sequential(QSAM) documents. RECORDING Setting IS FVU Saving Setting we use this to describe the file format of the reasonable records of the file. File format 1: RECORDING MODE Is definitely F This means that the logical record of the document is certainly of a set length, therefore all the information in the document will take up a fixed duration which is usually supplied in a COBOL system or in JCL. Structure 2: RECORDING MODE Is definitely Sixth is v This means that the reasonable record of the file will be of a variable length, hence all the information in the file will occupy a variable duration as per the description.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |