What is occurs depending on




















The below program read a fixed file 85 bytes containing inventory data of items, storage location and quantity available in each location and write the same into a variable length output file using occurs depending on clause. The record layout has a fixed portion of 10 bytes and a variable array whose size depends on the no of locations; the no of locations can have a minimum value of 1 to a maximum value of 5. The logic of the program is to read each input record and depending of the value of ITEM-IN-NO-OF-LOC , perform different paragraphs which writes the data into the variable array part of the output file , its self explanatory and I would urge you to go through the code.

WHEN 1. Index-name-1, index-name-2, Further, if the subject of this entry is the name of a group item, then all data-names belonging to the group must be subscripted or indexed whenever they are used as operands, except as the object of a REDEFINES clause.

This format specifies that the subject of this entry has a variable number of occurrences. The value of integer-2 represents the maximum number of occurrences and the value of integer-1 represents the minimum number of occurrences. This does not imply that the length of the subject of the entry is variable, but that the number of occurrences is variable.

The value of the data item referenced by data-name-1 must fall within the range of integer-1 through integer Reducing the value of this data item makes the contents of data items, whose occurrence numbers now exceed the value of the data item referenced by data-name-1, unpredictable. The first of the tables below specifies how storage is allocated for non-recursive programs. The second table specifies how storage is allocated for recursive programs.

General Formats for Format 1. General Formats for Format 2. General Formats for Format 3. Directives In addition to Compiler directives which provide flagging and modify the reserved word list, the following directives may impact either the syntax or the semantics described in this section.

Syntax Rules Where both integer-1 and integer-2 are used, integer-1 must be greater than or equal to zero and integer-2 must be greater than or equal to integer The data description of data-name-1 must describe an integer.

If there are any fields after this table, their position in the record will shift, depending on the number of occurrences of the table. There are three potential solutions.

In order of complexity, and using this example, they are: 1. You should define all 25 occurrences 75 fields in your database. If the size of the table is not too large, in both bytes and number of fields, DISC can convert ALL records so they have 25 occurrences of the table.

When we expand the number of occurrences in a particular record, say from 3 to 25, we fill the added character fields with spaces, and the added numeric fields with zeros. Be careful to calculate the final size before choosing this method.



0コメント

  • 1000 / 1000