Questions and Answers

  • The instructor asked if there were any questions, and it was stated that there were none.

Arrays in Java and Other Languages

  • In Java, an array can be declared and instantiated using a name with brackets [].
  • Objects can be added to a variable-length array using an ArrayList.

Types of Arrays in Java

  • **Primary Data Types: **
    • Integer array
    • Float array
    • Double array
    • Long array
    • Short array
    • Character array (similar to a string)

COBOL and Assembler Arrays

  • In COBOL and assembler, arrays are referred to as tables.
  • COBOL arrays can handle thousands of entries (e.g., 500,000). You can declare an array with a substantial number of entries and manage the storage easily.
  • COBOL is efficient and flexible, suitable for processing business transactions. Knowledge of COBOL is beneficial for entering various companies.

Employee Table Creation Assignment

  • The assignment involves creating an employee table.
  • If multiple tables have the same name, suffix them with numbers (e.g., EmployeeTable1, EmployeeTable2).

Data Storage Considerations

  • Key data fields for a single employee:
    • Hourly Pay
    • Hours Worked
    • Bonuses
    • Deductions
    • Employee Name (max length: 25 characters)
    • Employee ID (max length: 8 digits)
Field Length Specifications
  • Named fields with corresponding byte lengths:
    • Employee Name: 25 bytes
    • Employee ID: 8 digits
    • Hours Worked: 5 digits
    • Hourly Pay: 5 bytes
    • Bonus: 5 bytes
    • Deductions: 5 bytes
Calculating Entry Size
  • Total bytes occupied per employee entry:
    • (25+8+5+5+5+5=53)(25 + 8 + 5 + 5 + 5 + 5 = 53) (correcting to include all required fields)
  • For a table with 110 employee entries:
    • (110imes53=5830)(110 imes 53 = 5830) bytes total.

Looping and Storing Data

  • The first loop involves:
    • Reading the dataset and moving employee data into the table, no report creation or printing required during this initial loop.
    • Each employee entry in the table must be accessed through a pointer register initialized to the starting byte of the table.
    • The pointer register increments by 53 bytes for each subsequent employee entry.

Register Usage

  • The base register for a pointer to each entry in the table is crucial. The registration mechanism handles the data efficiently.
  • The approach avoids subscripting typically used in other programming languages; instead, displacements are used off a base register in assembler.

Dummy Section and DSECTs

  • DSECT stands for Dummy Section, which serves as a template laid over storage but does not allocate storage itself.
  • Proper naming conventions (e.g., using $) for fields within DSECTs are important for clarity and readability.
  • Any naming and DSECT must not have their corresponding storage defined until set aside above the CSECT.

Using the Dummy Section

  • To declare a DSECT, it should not include storage allocation commands such as DC. It merely describes a layout for the eventual storage allocation.
  • The implementation of a DSECT involves a USING and DROP statement so that the template follows the register that points at employee entries moving through the table.

Report Generation Loop

  • The second programming loop is responsible for generating reports from the entries in the table, traversing through each entry.
  • It should not involve any X-reads from external records, as it uses internal data only.

Entry and Exit Linkage

  • Standard entry and exit linkage are required in every subprogram, preserving register contents upon entering and leaving subprograms.
  • Registers, including caller program registers, must be saved and restored to maintain system integrity.
  • Internal and external subprograms can be distinguished within the CSECT structure of assembler programs.

Register Management

  • It is essential to avoid name duplication across different CSECTs and maintain clear structure and documentation.

Conclusion

  • This concludes the session, and the instructor suggests reviewing the material for understanding and preparation for practical applications in assembly language programming and COBOL assignments.