?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE job system label access procedures' ??
MODULE jmm$system_label_access;

{ PURPOSE:
{   This module contains the job-management procedures for accessing queue file
{   labels.

{ NOTES:
{ o Elements contained in the label of a queue file must be a multiple of eight bits
{   in length.  If they are not, #unchecked_conversion will produce problems with unset
{   bits and produce range errors.
{
{ o It is assumed that the following types will never change.  If they do, the 1.4.1 label
{   conversion code will stop functioning.
{     jmt$job_system_label_version
{     jmt$output_system_label_version
{     jmt$system_supplied_name
{     ost$date_time
{     ost$name
{     pmt$time_increment
{
{ o If an existing attribute needs to change its type, a new element identifier should be assigned
{   to preserve compatibility of the queue file label.  If the change is binary compatible, then the
{   existing element identifier in the queue file label can be used for as long as uninitialized bits
{   were previously initialized to zero (this zero pre-initialization would be
{   done by the process which packs the queue file label).

?? NEWTITLE := 'Global Declarations Referenced by this Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc jmc$system_family
*copyc jme$queued_file_conditions
*copyc jme$read_qfile_system_label
*copyc jme$write_qfile_system_label
*copyc fst$file_reference
*copyc jmt$job_system_label
*copyc jmt$output_system_label
*copyc jmt$qfile_system_label
*copyc ost$status
?? POP ??
*copyc fmp$get_jl_pointer2
*copyc fmp$put_jl_pointer
*copyc osp$set_status_condition
?? OLDTITLE ??
?? NEWTITLE := 'Global Declarations Declared by This Module', EJECT ??

{ This type defines the structure of the NOS/VE job_system_label at version
{ JL_version_0011.  This version was introduced in the 1.4.1 release of
{ NOS/VE.


{ This type depends on the following types not changing:
{   jmt$job_system_label_version
{   jmt$system_supplied_name
{   ost$date_time
{   ost$name
{   pmt$time_increment

  CONST
    new_job_system_label_version = 'JL_version_0012',
    old_job_system_label_version = 'JL_version_0011';

  TYPE
    old_job_system_label = record
      version: jmt$job_system_label_version,
      active_profile_version: ost$name,
      assigned_job_class: ost$name,
      data_declaration: string (2),
      data_mode: 0 .. 2,
      disposition_code: string (2),
      job_abort_disposition: 0 .. 1,
      job_attributes: old_job_attributes,
      job_category_set: set of 0 .. 63,
      job_class_name: ost$name,
      job_deferred_by_operator: boolean,
      job_deferred_by_user: boolean,
      job_destination_family: ost$name,
      job_destination_usage: ost$name,
      job_execution_ring: 0 .. 15,
      job_initiation_location: string (17),
      job_mode: 0 .. 4,
      job_priority: ost$name,
      job_recovery_disposition: 0 .. 2,
      limit_information: old_job_label_limit_information,
      login_account: ost$name,
      login_project: ost$name,
      login_password: ost$name,
      login_user_identification: record
        user: ost$name,
        family: ost$name,
      recend,
      optional_user_capability: ost$name,
      originating_login_account: ost$name,
      originating_login_family: ost$name,
      originating_login_project: ost$name,
      originating_login_user: ost$name,
      perform_class_validation: boolean,
      required_user_capability: ost$name,
      system_job_name: jmt$system_supplied_name,
      user_job_name: ost$name,
    recend;

  TYPE
    old_job_label_limit_information = record
      cpu_time_limit_specified: boolean,
      cpu_time_limit_requested: integer,
      cpu_time_limit_assigned: integer,
      magnetic_tape_limit_specified: boolean,
      magnetic_tape_limit_requested: 0 .. 104,
      magnetic_tape_limit_assigned: 0 .. 104,
      maximum_working_set_specified: boolean,
      maximum_working_set_requested: 20 .. 65004,
      maximum_working_set_assigned: 20 .. 65004,
      sru_limit_specified: boolean,
      sru_limit_requested: integer,
      sru_limit_assigned: integer,
    recend;

  TYPE
    old_job_attributes = record
      comment_banner: ost$name,
      copy_count: 0 .. 10,
      device: ost$name,
      earliest_run_time: old_date_time,
      earliest_print_time: old_date_time,
      external_characteristics: string (6),
      forms_code: string (6),
      implicit_routing_text: record
        size: 0 .. 256,
        text: string (256),
      recend,
      job_controller: record
        user: ost$name,
        family: ost$name,
      recend,
      job_initiation_time: ost$date_time,
      job_input_device: record
        size: 0 .. 256,
        text: string (256),
      recend,
      job_qualifier_list: array [1 .. 5] of ost$name,
      job_size: 0 .. 07fffffff(16),
      job_submission_time: ost$date_time,
      latest_run_time: old_date_time,
      latest_print_time: old_date_time,
      login_command_supplied: boolean,
      originating_application_name: ost$name,
      originating_ssn: jmt$system_supplied_name,
      output_class: ost$name,
      output_deferred_by_user: boolean,
      output_destination: ost$name,
      output_destination_family: ost$name, { operator_family
      output_destination_usage: ost$name,
      output_disposition_key: 0 .. 5,
      output_disposition_path: string (512),
      output_priority: ost$name,
      process_user_prolog_and_epilog: boolean,
      purge_delay: old_time_increment,
      remote_host_directive: record
        size: 0 .. 256,
        parameters: string (256),
      recend,
      routing_banner: ost$name,
      source_logical_id: ost$name,
      site_information: string (256),
      station: ost$name,
      station_operator: ost$name, { operator_user
      system_job_parameters: record
        system_job_parameter_count: 0 .. 256,
        system_job_parameter: string (256),
      recend,
      system_routing_text: record
        size: 0 .. 256,
        parameters: string (256),
      recend,
      user_information: string (256),
      vertical_print_density: 0 .. 8,
      vfu_load_procedure: ost$name,
    recend;

  TYPE
    old_date_time = record
      case specified: boolean of
      = TRUE =
        date_time: ost$date_time,
      = FALSE =
        ,
      casend,
    recend;

  TYPE
    old_time_increment = record
      case specified: boolean of
      = TRUE =
        time_increment: pmt$time_increment,
      = FALSE =
        ,
      casend,
    recend;

{ This type defines the structure of the NOS/VE output_system_label at version
{ OL_version_0009.  This version was introduced in the 1.4.1 release of
{ NOS/VE.


{ This type depends on the following types not changing:
{   jmt$output_system_label_version
{   jmt$system_supplied_name
{   ost$date_time
{   ost$name
{   pmt$time_increment

  CONST
    new_output_system_label_version = 'OL_version_0010',
    old_output_system_label_version = 'OL_version_0009';


  TYPE
    old_output_system_label = record
      version: jmt$output_system_label_version,
      comment_banner: ost$name,
      copies_printed: 0 .. 10,
      copy_count: 0 .. 10,
      data_declaration: string (2),
      data_mode: 0 .. 2,
      device: ost$name,
      device_type: 0 .. 2,
      disposition_code: string (2),
      dual_state_account: ost$name,
      dual_state_family_name: ost$name,
      dual_state_password: ost$name,
      dual_state_project: ost$name,
      dual_state_user: ost$name,
      earliest_print_time: old_date_time,
      external_characteristics: string (6),
      file_position: 0 .. 07fffffff(16),
      file_size: 0 .. 07fffffff(16),
      forms_code: string (6),
      implicit_routing_text: record
        size: 0 .. 256,
        text: string (256),
      recend,
      latest_print_time: old_date_time,
      login_account: ost$name,
      login_project: ost$name,
      login_user_identification: record
        user: ost$name,
        family: ost$name,
      recend,
      originating_application_name: ost$name,
      output_class: ost$name,
      output_controller: record
        user: ost$name,
        family: ost$name,
      recend,
      output_deferred_by_operator: boolean,
      output_deferred_by_user: boolean,
      output_destination: ost$name,
      output_destination_family: ost$name, { operator_family
      output_destination_usage: ost$name,
      output_disposition_key: 0 .. 5,
      output_disposition_time: old_date_time,
      output_priority: ost$name,
      output_submission_time: ost$date_time,
      purge_delay: old_time_increment,
      remote_host_directive: record
        size: 0 .. 256,
        parameters: string (256),
      recend,
      routing_banner: ost$name,
      site_information: string (256),
      source_logical_id: ost$name,
      station: ost$name,
      station_operator: ost$name, { operator_user
      system_file_name: jmt$system_supplied_name,
      system_job_name: jmt$system_supplied_name,
      system_routing_text: record
        size: 0 .. 256,
        parameters: string (256),
      recend,
      user_information: string (256),
      user_file_name: ost$name,
      user_job_name: ost$name,
      vertical_print_density: 0 .. 8,
      vfu_load_procedure: ost$name,
    recend;

  TYPE
    t$label_element_header = record
      element_identifier: t$element_identifier,
      element_size: t$element_size,
    recend,
    t$element_identifier = 0 .. c$maximum_elements,
    t$element_size = 0 .. c$maximum_element_size;

  CONST
    c$maximum_elements = 1000,
    c$maximum_element_size = 32767;

  CONST
    c$active_profile_version = 10,
    c$application_attributes = 15,
    c$application_name = 17,
    c$application_status = 18,
    c$assigned_job_class = 20,
    c$comment_banner = 30,
    c$control_family = 40,
    c$control_user = 50,
    c$copies_printed = 60,
    c$copy_count = 70,
    c$cpu_time_limit_assigned = 80,
    c$cpu_time_limit_requested = 90,
    c$cpu_time_limit_specified = 100,
    c$data_declaration = 110,
    c$data_mode = 120,
    c$deferred_by_application = 125,
    c$deferred_by_operator = 126,
    c$deferred_by_user = 127,
    c$destination = 128,
    c$device = 130,
    c$device_type = 140,
    c$disposition_code = 150,
    c$disposition_time = 155,
    c$dual_state_account = 160,
    c$dual_state_family = 170,
    c$dual_state_password = 180,
    c$dual_state_project = 190,
    c$dual_state_user = 200,
    c$earliest_print_time = 210,
    c$earliest_run_time = 220,
    c$external_characteristics = 230,
    c$file_position = 240,
    c$file_size = 250,
    c$forms_code = 260,
    c$implicit_routing_text = 270,
    c$job_abort_disposition = 280,
    c$job_category_set = 290,
    c$job_class_name = 300,
    c$job_deferred_by_operator = 310,
    c$job_deferred_by_user = 320,
    c$job_destination_family = 330,
    c$job_destination_usage = 340,
    c$job_execution_ring = 350,
    c$job_initiation_location = 360,
    c$job_initiation_time = 370,
    c$job_input_device = 380,
    c$job_mode = 390,
    c$job_priority = 400,
    c$job_qualifier_list = 410,
    c$job_recovery_disposition = 420,
    c$job_submission_time = 430,
    c$latest_print_time = 440,
    c$latest_run_time = 450,
    c$login_account = 460,
    c$login_command_supplied = 470,
    c$login_family = 480,
    c$login_password = 490,
    c$login_project = 500,
    c$login_user = 510,
    c$magnetic_tape_limit_assigned = 520,
    c$magnetic_tape_limit_requested = 530,
    c$magnetic_tape_limit_specified = 540,
    c$maximum_working_set_assigned = 550,
    c$maximum_working_set_requested = 560,
    c$maximum_working_set_specified = 570,
    c$optional_user_capability = 580,
    c$originating_application_name = 590,
    c$originating_login_account = 600,
    c$originating_login_family = 610,
    c$originating_login_project = 620,
    c$originating_login_user = 630,
    c$originating_ssn = 640,
    c$output_class = 650,
    c$output_deferred_by_operator = 660,
    c$output_deferred_by_user = 670,
    c$output_destination = 680,
    c$output_destination_family = 690,
    c$output_destination_usage = 700,
    c$output_disposition_key = 710,
    c$output_disposition_path = 720,
    c$output_disposition_time = 730,
    c$output_priority = 740,
    c$output_submission_time = 750,
    c$perform_class_validation = 760,
    c$process_user_prolog_epilog = 770,
    c$purge_delay = 780,
    c$remote_host_directive = 790,
    c$required_user_capability = 800,
    c$routing_banner = 810,
    c$site_information = 820,
    c$source_logical_id = 830,
    c$sru_limit_assigned = 840,
    c$sru_limit_requested = 850,
    c$sru_limit_specified = 860,
    c$station = 870,
    c$station_operator = 880,
    c$system_file_name = 890,
    c$system_job_name = 900,
    c$system_job_parameters = 910,
    c$system_routing_text = 920,
    c$user_file_name = 930,
    c$user_information = 940,
    c$user_job_name = 950,
    c$version = 960,
    c$vertical_print_density = 970,
    c$vfu_load_procedure = 980;

?? OLDTITLE ??
?? NEWTITLE := '[XDCL, #GATE] qfp$read_job_system_label', EJECT ??
*copy qfh$read_job_system_label

  PROCEDURE [XDCL, #GATE] qfp$read_job_system_label
    (    file_reference: fst$file_reference;
     VAR system_label: jmt$job_system_label;
     VAR status: ost$status);

    VAR
      job_label_p: ^SEQ ( * ),
      job_label_version_p: ^jmt$job_system_label_version;

?? NEWTITLE := 'unpack_old_job_label', EJECT ??

    PROCEDURE unpack_old_job_label
      (VAR job_label_p {input} : ^SEQ ( * );
       VAR system_label: jmt$job_system_label);

      VAR
        job_system_label_p: ^old_job_system_label;

      RESET job_label_p;
      NEXT job_system_label_p IN job_label_p;
      system_label.version := job_system_label_p^.version;
      system_label.active_profile_version := job_system_label_p^.active_profile_version;
      system_label.assigned_job_class := job_system_label_p^.assigned_job_class;
      system_label.data_declaration := job_system_label_p^.data_declaration;
      #UNCHECKED_CONVERSION (job_system_label_p^.data_mode, system_label.data_mode);
      system_label.disposition_code := job_system_label_p^.disposition_code;
      #UNCHECKED_CONVERSION (job_system_label_p^.job_abort_disposition, system_label.job_abort_disposition);
      system_label.job_attributes.comment_banner := job_system_label_p^.job_attributes.comment_banner;
      system_label.job_attributes.copy_count := job_system_label_p^.job_attributes.copy_count;
      system_label.job_attributes.device := job_system_label_p^.job_attributes.device;
      system_label.job_attributes.earliest_run_time := job_system_label_p^.job_attributes.earliest_run_time;
      system_label.job_attributes.earliest_print_time := job_system_label_p^.job_attributes.
            earliest_print_time;
      system_label.job_attributes.external_characteristics :=
            job_system_label_p^.job_attributes.external_characteristics;
      system_label.job_attributes.forms_code := job_system_label_p^.job_attributes.forms_code;
      system_label.job_attributes.implicit_routing_text :=
            job_system_label_p^.job_attributes.implicit_routing_text;
      system_label.job_attributes.job_controller := job_system_label_p^.job_attributes.job_controller;
      system_label.job_attributes.job_initiation_time := job_system_label_p^.job_attributes.
            job_initiation_time;
      system_label.job_attributes.job_input_device := job_system_label_p^.job_attributes.job_input_device;
      system_label.job_attributes.job_qualifier_list := job_system_label_p^.job_attributes.job_qualifier_list;
      system_label.job_attributes.job_size := job_system_label_p^.job_attributes.job_size;
      system_label.job_attributes.job_submission_time := job_system_label_p^.job_attributes.
            job_submission_time;
      system_label.job_attributes.latest_run_time := job_system_label_p^.job_attributes.latest_run_time;
      system_label.job_attributes.latest_print_time := job_system_label_p^.job_attributes.latest_print_time;
      system_label.job_attributes.login_command_supplied :=
            job_system_label_p^.job_attributes.login_command_supplied;
      system_label.job_attributes.originating_application_name :=
            job_system_label_p^.job_attributes.originating_application_name;
      system_label.job_attributes.originating_ssn := job_system_label_p^.job_attributes.originating_ssn;
      system_label.job_attributes.output_class := job_system_label_p^.job_attributes.output_class;
      system_label.job_attributes.output_deferred_by_user :=
            job_system_label_p^.job_attributes.output_deferred_by_user;
      system_label.job_attributes.output_destination := job_system_label_p^.job_attributes.output_destination;
      system_label.job_attributes.output_destination_family :=
            job_system_label_p^.job_attributes.output_destination_family;
      system_label.job_attributes.output_destination_usage :=
            job_system_label_p^.job_attributes.output_destination_usage;
      #UNCHECKED_CONVERSION (job_system_label_p^.job_attributes.output_disposition_key,
            system_label.job_attributes.output_disposition_key);
      system_label.job_attributes.output_disposition_path :=
            job_system_label_p^.job_attributes.output_disposition_path;
      system_label.job_attributes.output_priority := job_system_label_p^.job_attributes.output_priority;
      system_label.job_attributes.process_user_prolog_and_epilog :=
            job_system_label_p^.job_attributes.process_user_prolog_and_epilog;
      system_label.job_attributes.purge_delay := job_system_label_p^.job_attributes.purge_delay;
      system_label.job_attributes.remote_host_directive :=
            job_system_label_p^.job_attributes.remote_host_directive;
      system_label.job_attributes.routing_banner := job_system_label_p^.job_attributes.routing_banner;
      system_label.job_attributes.source_logical_id := job_system_label_p^.job_attributes.source_logical_id;
      system_label.job_attributes.site_information := job_system_label_p^.job_attributes.site_information;
      system_label.job_attributes.station := job_system_label_p^.job_attributes.station;
      system_label.job_attributes.station_operator := job_system_label_p^.job_attributes.station_operator;
      system_label.job_attributes.system_job_parameters :=
            job_system_label_p^.job_attributes.system_job_parameters;
      system_label.job_attributes.system_routing_text := job_system_label_p^.job_attributes.
            system_routing_text;
      system_label.job_attributes.user_information := job_system_label_p^.job_attributes.user_information;
      #UNCHECKED_CONVERSION (job_system_label_p^.job_attributes.vertical_print_density,
            system_label.job_attributes.vertical_print_density);
      system_label.job_attributes.vfu_load_procedure := job_system_label_p^.job_attributes.vfu_load_procedure;
      #UNCHECKED_CONVERSION (job_system_label_p^.job_category_set, system_label.job_category_set);
      system_label.job_class_name := job_system_label_p^.job_class_name;
      system_label.job_deferred_by_operator := job_system_label_p^.job_deferred_by_operator;
      system_label.job_deferred_by_user := job_system_label_p^.job_deferred_by_user;
      system_label.job_destination_family := job_system_label_p^.job_destination_family;
      system_label.job_destination_usage := job_system_label_p^.job_destination_usage;
      system_label.job_execution_ring := job_system_label_p^.job_execution_ring;
      system_label.job_initiation_location := job_system_label_p^.job_initiation_location;
      #UNCHECKED_CONVERSION (job_system_label_p^.job_mode, system_label.job_mode);
      system_label.job_priority := job_system_label_p^.job_priority;
      #UNCHECKED_CONVERSION (job_system_label_p^.job_recovery_disposition,
            system_label.job_recovery_disposition);
      system_label.limit_information.cpu_time_limit_specified :=
            job_system_label_p^.limit_information.cpu_time_limit_specified;
      system_label.limit_information.cpu_time_limit_requested :=
            job_system_label_p^.limit_information.cpu_time_limit_requested;
      system_label.limit_information.cpu_time_limit_assigned :=
            job_system_label_p^.limit_information.cpu_time_limit_assigned;
      system_label.limit_information.magnetic_tape_limit_specified :=
            job_system_label_p^.limit_information.magnetic_tape_limit_specified;
      system_label.limit_information.magnetic_tape_limit_requested :=
            job_system_label_p^.limit_information.magnetic_tape_limit_requested;
      system_label.limit_information.magnetic_tape_limit_assigned :=
            job_system_label_p^.limit_information.magnetic_tape_limit_assigned;
      system_label.limit_information.maximum_working_set_specified :=
            job_system_label_p^.limit_information.maximum_working_set_specified;
      system_label.limit_information.maximum_working_set_requested :=
            job_system_label_p^.limit_information.maximum_working_set_requested;
      system_label.limit_information.maximum_working_set_assigned :=
            job_system_label_p^.limit_information.maximum_working_set_assigned;
      system_label.limit_information.sru_limit_specified :=
            job_system_label_p^.limit_information.sru_limit_specified;
      system_label.limit_information.sru_limit_requested :=
            job_system_label_p^.limit_information.sru_limit_requested;
      system_label.limit_information.sru_limit_assigned :=
            job_system_label_p^.limit_information.sru_limit_assigned;
      system_label.login_account := job_system_label_p^.login_account;
      system_label.login_password := job_system_label_p^.login_password;
      system_label.login_project := job_system_label_p^.login_project;
      system_label.login_user_identification := job_system_label_p^.login_user_identification;
      system_label.optional_user_capability := job_system_label_p^.optional_user_capability;
      system_label.originating_login_account := job_system_label_p^.originating_login_account;
      system_label.originating_login_family := job_system_label_p^.originating_login_family;
      system_label.originating_login_project := job_system_label_p^.originating_login_project;
      system_label.originating_login_user := job_system_label_p^.originating_login_user;
      system_label.perform_class_validation := job_system_label_p^.perform_class_validation;
      system_label.required_user_capability := job_system_label_p^.required_user_capability;
      system_label.system_job_name := job_system_label_p^.system_job_name;
      system_label.user_job_name := job_system_label_p^.user_job_name;

{ Initialize the fields that have been added to the job label since 1.4.1 with
{ default values.

{ Currently, there are none.

    PROCEND unpack_old_job_label;
?? OLDTITLE ??
?? NEWTITLE := 'unpack_standard_job_label', EJECT ??

    PROCEDURE unpack_standard_job_label
      (VAR job_label_p {input} : ^SEQ ( * );
       VAR system_label: jmt$job_system_label;
       VAR status: ost$status);

      VAR
        element_p: ^string ( * <= c$maximum_element_size),
        field_header_p: ^t$label_element_header;

      status.normal := TRUE;

{ Initialize any fields that have been added to the standard job system label since it
{ was of the form of the old label (1.5.2).

{ Currently, there are no new fields.

      system_label.version := new_job_system_label_version;

      NEXT field_header_p IN job_label_p;
      WHILE field_header_p <> NIL DO
        IF field_header_p^.element_size > 0 THEN
          NEXT element_p: [field_header_p^.element_size] IN job_label_p;
          IF element_p = NIL THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
        ELSE
          element_p := NIL;
        IFEND;

        CASE field_header_p^.element_identifier OF
        = c$active_profile_version =
          IF field_header_p^.element_size <> #SIZE (system_label.active_profile_version) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.active_profile_version);

        = c$assigned_job_class =
          IF field_header_p^.element_size <> #SIZE (system_label.assigned_job_class) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.assigned_job_class);

        = c$comment_banner =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.comment_banner) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.comment_banner);

        = c$control_family =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.job_controller.family) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.job_controller.family);

        = c$control_user =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.job_controller.user) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.job_controller.user);

        = c$copy_count =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.copy_count) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.copy_count);

        = c$cpu_time_limit_assigned =
          IF field_header_p^.element_size <> #SIZE (system_label.limit_information.cpu_time_limit_assigned)
                THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.limit_information.cpu_time_limit_assigned);

        = c$cpu_time_limit_requested =
          IF field_header_p^.element_size <> #SIZE (system_label.limit_information.cpu_time_limit_requested)
                THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.limit_information.cpu_time_limit_requested);

        = c$cpu_time_limit_specified =
          IF field_header_p^.element_size <> #SIZE (system_label.limit_information.cpu_time_limit_specified)
                THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.limit_information.cpu_time_limit_specified);

        = c$data_declaration =
          IF field_header_p^.element_size <> #SIZE (system_label.data_declaration) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.data_declaration);

        = c$data_mode =
          IF field_header_p^.element_size <> #SIZE (system_label.data_mode) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.data_mode);

        = c$device =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.device) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.device);

        = c$disposition_code =
          IF field_header_p^.element_size <> #SIZE (system_label.disposition_code) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.disposition_code);

        = c$earliest_print_time =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.earliest_print_time) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.earliest_print_time);

        = c$earliest_run_time =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.earliest_run_time) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.earliest_run_time);

        = c$external_characteristics =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.external_characteristics) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.external_characteristics);

        = c$file_size =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.job_size) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.job_size);

        = c$forms_code =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.forms_code) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.forms_code);

        = c$implicit_routing_text =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.implicit_routing_text) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.implicit_routing_text);

        = c$job_abort_disposition =
          IF field_header_p^.element_size <> #SIZE (system_label.job_abort_disposition) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_abort_disposition);

        = c$job_category_set =
          IF field_header_p^.element_size <> #SIZE (system_label.job_category_set) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_category_set);

        = c$job_class_name =
          IF field_header_p^.element_size <> #SIZE (system_label.job_class_name) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_class_name);

        = c$job_deferred_by_operator =
          IF field_header_p^.element_size <> #SIZE (system_label.job_deferred_by_operator) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_deferred_by_operator);

        = c$job_deferred_by_user =
          IF field_header_p^.element_size <> #SIZE (system_label.job_deferred_by_user) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_deferred_by_user);

        = c$job_destination_family =
          IF field_header_p^.element_size <> #SIZE (system_label.job_destination_family) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_destination_family);

        = c$job_destination_usage =
          IF field_header_p^.element_size <> #SIZE (system_label.job_destination_usage) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_destination_usage);

        = c$job_execution_ring =
          IF field_header_p^.element_size <> #SIZE (system_label.job_execution_ring) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_execution_ring);

        = c$job_initiation_location =
          IF field_header_p^.element_size <> #SIZE (system_label.job_initiation_location) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_initiation_location);

        = c$job_initiation_time =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.job_initiation_time) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.job_initiation_time);

        = c$job_input_device =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.job_input_device) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.job_input_device);

        = c$job_mode =
          IF field_header_p^.element_size <> #SIZE (system_label.job_mode) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_mode);

        = c$job_priority =
          IF field_header_p^.element_size <> #SIZE (system_label.job_priority) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_priority);

        = c$job_qualifier_list =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.job_qualifier_list) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.job_qualifier_list);

        = c$job_recovery_disposition =
          IF field_header_p^.element_size <> #SIZE (system_label.job_recovery_disposition) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_recovery_disposition);

        = c$job_submission_time =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.job_submission_time) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.job_submission_time);

        = c$latest_print_time =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.latest_print_time) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.latest_print_time);

        = c$latest_run_time =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.latest_run_time) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.latest_run_time);

        = c$login_account =
          IF field_header_p^.element_size <> #SIZE (system_label.login_account) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.login_account);

        = c$login_command_supplied =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.login_command_supplied) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.login_command_supplied);

        = c$login_family =
          IF field_header_p^.element_size <> #SIZE (system_label.login_user_identification.family) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.login_user_identification.family);

        = c$login_password =
          IF field_header_p^.element_size <> #SIZE (system_label.login_password) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.login_password);

        = c$login_project =
          IF field_header_p^.element_size <> #SIZE (system_label.login_project) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.login_project);

        = c$login_user =
          IF field_header_p^.element_size <> #SIZE (system_label.login_user_identification.user) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.login_user_identification.user);

        = c$magnetic_tape_limit_assigned =
          IF field_header_p^.element_size <> #SIZE (system_label.limit_information.
                magnetic_tape_limit_assigned) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.limit_information.magnetic_tape_limit_assigned);

        = c$magnetic_tape_limit_requested =
          IF field_header_p^.element_size <> #SIZE (system_label.limit_information.
                magnetic_tape_limit_requested) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.limit_information.magnetic_tape_limit_requested);

        = c$magnetic_tape_limit_specified =
          IF field_header_p^.element_size <> #SIZE (system_label.limit_information.
                magnetic_tape_limit_specified) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.limit_information.magnetic_tape_limit_specified);

        = c$maximum_working_set_assigned =
          IF field_header_p^.element_size <> #SIZE (system_label.limit_information.
                maximum_working_set_assigned) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.limit_information.maximum_working_set_assigned);

        = c$maximum_working_set_requested =
          IF field_header_p^.element_size <> #SIZE (system_label.limit_information.
                maximum_working_set_requested) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.limit_information.maximum_working_set_requested);

        = c$maximum_working_set_specified =
          IF field_header_p^.element_size <> #SIZE (system_label.limit_information.
                maximum_working_set_specified) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.limit_information.maximum_working_set_specified);

        = c$optional_user_capability =
          IF field_header_p^.element_size <> #SIZE (system_label.optional_user_capability) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.optional_user_capability);

        = c$originating_application_name =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.originating_application_name)
                THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.originating_application_name);

        = c$originating_login_account =
          IF field_header_p^.element_size <> #SIZE (system_label.originating_login_account) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.originating_login_account);

        = c$originating_login_family =
          IF field_header_p^.element_size <> #SIZE (system_label.originating_login_family) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.originating_login_family);

        = c$originating_login_project =
          IF field_header_p^.element_size <> #SIZE (system_label.originating_login_project) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.originating_login_project);

        = c$originating_login_user =
          IF field_header_p^.element_size <> #SIZE (system_label.originating_login_user) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.originating_login_user);

        = c$originating_ssn =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.originating_ssn) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.originating_ssn);

        = c$output_class =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.output_class) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.output_class);

        = c$output_deferred_by_user =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.output_deferred_by_user) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.output_deferred_by_user);

        = c$output_destination =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.output_destination) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.output_destination);

        = c$output_destination_family =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.output_destination_family)
                THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.output_destination_family);

        = c$output_destination_usage =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.output_destination_usage) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.output_destination_usage);

        = c$output_disposition_key =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.output_disposition_key) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.output_disposition_key);

        = c$output_disposition_path =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.output_disposition_path) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.output_disposition_path);

        = c$output_priority =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.output_priority) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.output_priority);

        = c$perform_class_validation =
          IF field_header_p^.element_size <> #SIZE (system_label.perform_class_validation) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.perform_class_validation);

        = c$process_user_prolog_epilog =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.
                process_user_prolog_and_epilog) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.process_user_prolog_and_epilog);

        = c$purge_delay =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.purge_delay) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.purge_delay);

        = c$remote_host_directive =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.remote_host_directive) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.remote_host_directive);

        = c$required_user_capability =
          IF field_header_p^.element_size <> #SIZE (system_label.required_user_capability) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.required_user_capability);

        = c$routing_banner =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.routing_banner) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.routing_banner);

        = c$site_information =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.site_information) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.site_information);

        = c$source_logical_id =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.source_logical_id) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.source_logical_id);

        = c$sru_limit_assigned =
          IF field_header_p^.element_size <> #SIZE (system_label.limit_information.sru_limit_assigned) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.limit_information.sru_limit_assigned);

        = c$sru_limit_requested =
          IF field_header_p^.element_size <> #SIZE (system_label.limit_information.sru_limit_requested) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.limit_information.sru_limit_requested);

        = c$sru_limit_specified =
          IF field_header_p^.element_size <> #SIZE (system_label.limit_information.sru_limit_specified) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.limit_information.sru_limit_specified);

        = c$station =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.station) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.station);

        = c$station_operator =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.station_operator) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.station_operator);

        = c$system_job_name =
          IF field_header_p^.element_size <> #SIZE (system_label.system_job_name) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.system_job_name);

        = c$system_job_parameters =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.system_job_parameters) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.system_job_parameters);

        = c$system_routing_text =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.system_routing_text) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.system_routing_text);

        = c$user_information =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.user_information) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.user_information);

        = c$user_job_name =
          IF field_header_p^.element_size <> #SIZE (system_label.user_job_name) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.user_job_name);

        = c$version =

{ Shouldn't ever get here, but, just in case...

        = c$vertical_print_density =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.vertical_print_density) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.vertical_print_density);

        = c$vfu_load_procedure =
          IF field_header_p^.element_size <> #SIZE (system_label.job_attributes.vfu_load_procedure) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.job_attributes.vfu_load_procedure);

        ELSE

{ An unknown label element has been found.  The label must have been generated on
{ a predecessor system to the currently executing system.  Ignore unknown attributes.

        CASEND;

        NEXT field_header_p IN job_label_p;
      WHILEND;
    PROCEND unpack_standard_job_label;
?? OLDTITLE ??
?? EJECT ??
    status.normal := TRUE;

    fmp$get_jl_pointer (file_reference, {append} FALSE, job_label_p, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    RESET job_label_p;
    NEXT job_label_version_p IN job_label_p;
    IF job_label_version_p = NIL THEN
      osp$set_status_condition (jme$read_job_system_label, status);
      RETURN; {----->
    IFEND;

    IF job_label_version_p^ = old_job_system_label_version THEN
      unpack_old_job_label (job_label_p, system_label);
    ELSEIF job_label_version_p^ = new_job_system_label_version THEN
      unpack_standard_job_label (job_label_p, system_label, status);
    ELSE
      osp$set_status_condition (jme$sl_version_mismatch, status);
      RETURN; {----->
    IFEND;

  PROCEND qfp$read_job_system_label;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL, #GATE] qfp$read_output_system_label', EJECT ??
*copy qfh$read_output_system_label

  PROCEDURE [XDCL, #GATE] qfp$read_output_system_label
    (    file_reference: fst$file_reference;
     VAR system_label: jmt$output_system_label;
     VAR status: ost$status);

    VAR
      output_label_p: ^SEQ ( * ),
      output_label_version_p: ^jmt$output_system_label_version;

?? NEWTITLE := 'unpack_old_output_label', EJECT ??

    PROCEDURE unpack_old_output_label
      (VAR output_label_p {input} : ^SEQ ( * );
       VAR system_label: jmt$output_system_label);

      VAR
        output_system_label_p: ^old_output_system_label;

      status.normal := TRUE;
      RESET output_label_p;
      NEXT output_system_label_p IN output_label_p;
      system_label.version := output_system_label_p^.version;
      system_label.comment_banner := output_system_label_p^.comment_banner;
      system_label.copies_printed := output_system_label_p^.copies_printed;
      system_label.copy_count := output_system_label_p^.copy_count;
      system_label.data_declaration := output_system_label_p^.data_declaration;
      #UNCHECKED_CONVERSION (output_system_label_p^.data_mode, system_label.data_mode);
      system_label.device := output_system_label_p^.device;
      #UNCHECKED_CONVERSION (output_system_label_p^.device_type, system_label.device_type);
      system_label.disposition_code := output_system_label_p^.disposition_code;
      system_label.dual_state_account := output_system_label_p^.dual_state_account;
      system_label.dual_state_family_name := output_system_label_p^.dual_state_family_name;
      system_label.dual_state_password := output_system_label_p^.dual_state_password;
      system_label.dual_state_project := output_system_label_p^.dual_state_project;
      system_label.dual_state_user := output_system_label_p^.dual_state_user;
      system_label.earliest_print_time := output_system_label_p^.earliest_print_time;
      system_label.external_characteristics := output_system_label_p^.external_characteristics;
      system_label.file_position := output_system_label_p^.file_position;
      system_label.file_size := output_system_label_p^.file_size;
      system_label.forms_code := output_system_label_p^.forms_code;
      system_label.implicit_routing_text := output_system_label_p^.implicit_routing_text;
      system_label.latest_print_time := output_system_label_p^.latest_print_time;
      system_label.login_account := output_system_label_p^.login_account;
      system_label.login_project := output_system_label_p^.login_project;
      system_label.login_user_identification := output_system_label_p^.login_user_identification;
      system_label.originating_application_name := output_system_label_p^.originating_application_name;
      system_label.output_class := output_system_label_p^.output_class;
      system_label.output_controller := output_system_label_p^.output_controller;
      system_label.output_deferred_by_operator := output_system_label_p^.output_deferred_by_operator;
      system_label.output_deferred_by_user := output_system_label_p^.output_deferred_by_user;
      system_label.output_destination := output_system_label_p^.output_destination;
      system_label.output_destination_family := output_system_label_p^.output_destination_family;
      system_label.output_destination_usage := output_system_label_p^.output_destination_usage;
      #UNCHECKED_CONVERSION (output_system_label_p^.output_disposition_key,
            system_label.output_disposition_key);
      system_label.output_disposition_time := output_system_label_p^.output_disposition_time;
      system_label.output_priority := output_system_label_p^.output_priority;
      system_label.output_submission_time := output_system_label_p^.output_submission_time;
      system_label.purge_delay := output_system_label_p^.purge_delay;
      system_label.remote_host_directive := output_system_label_p^.remote_host_directive;
      system_label.routing_banner := output_system_label_p^.routing_banner;
      system_label.site_information := output_system_label_p^.site_information;
      system_label.source_logical_id := output_system_label_p^.source_logical_id;
      system_label.station := output_system_label_p^.station;
      system_label.station_operator := output_system_label_p^.station_operator;
      system_label.system_file_name := output_system_label_p^.system_file_name;
      system_label.system_job_name := output_system_label_p^.system_job_name;
      system_label.system_routing_text := output_system_label_p^.system_routing_text;
      system_label.user_information := output_system_label_p^.user_information;
      system_label.user_file_name := output_system_label_p^.user_file_name;
      system_label.user_job_name := output_system_label_p^.user_job_name;
      #UNCHECKED_CONVERSION (output_system_label_p^.vertical_print_density,
            system_label.vertical_print_density);
      system_label.vfu_load_procedure := output_system_label_p^.vfu_load_procedure;

{ Initialize the fields that have been added to the output label since 1.4.1 with
{ default values.

{ Currently, there are none.

    PROCEND unpack_old_output_label;
?? OLDTITLE ??
?? NEWTITLE := 'unpack_standard_output_label', EJECT ??

    PROCEDURE unpack_standard_output_label
      (VAR output_label_p {input} : ^SEQ ( * );
       VAR system_label: jmt$output_system_label;
       VAR status: ost$status);

      VAR
        element_p: ^string ( * <= c$maximum_element_size),
        field_header_p: ^t$label_element_header;

      status.normal := TRUE;

{ Initialize any fields that have been added to the output system label since it
{ was of the form of the old label (1.5.2).

{ Currently, there are no new fields.

      system_label.version := new_output_system_label_version;

      NEXT field_header_p IN output_label_p;
      WHILE field_header_p <> NIL DO
        IF field_header_p^.element_size > 0 THEN
          NEXT element_p: [field_header_p^.element_size] IN output_label_p;
          IF element_p = NIL THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
        ELSE
          element_p := NIL;
        IFEND;

        CASE field_header_p^.element_identifier OF
        = c$comment_banner =
          IF field_header_p^.element_size <> #SIZE (system_label.comment_banner) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.comment_banner);

        = c$control_family =
          IF field_header_p^.element_size <> #SIZE (system_label.output_controller.family) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.output_controller.family);

        = c$control_user =
          IF field_header_p^.element_size <> #SIZE (system_label.output_controller.user) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.output_controller.user);

        = c$copies_printed =
          IF field_header_p^.element_size <> #SIZE (system_label.copies_printed) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.copies_printed);

        = c$copy_count =
          IF field_header_p^.element_size <> #SIZE (system_label.copy_count) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.copy_count);

        = c$data_declaration =
          IF field_header_p^.element_size <> #SIZE (system_label.data_declaration) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.data_declaration);

        = c$data_mode =
          IF field_header_p^.element_size <> #SIZE (system_label.data_mode) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.data_mode);

        = c$device =
          IF field_header_p^.element_size <> #SIZE (system_label.device) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.device);

        = c$device_type =
          IF field_header_p^.element_size <> #SIZE (system_label.device_type) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.device_type);

        = c$disposition_code =
          IF field_header_p^.element_size <> #SIZE (system_label.disposition_code) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.disposition_code);

        = c$dual_state_account =
          IF field_header_p^.element_size <> #SIZE (system_label.dual_state_account) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.dual_state_account);

        = c$dual_state_family =
          IF field_header_p^.element_size <> #SIZE (system_label.dual_state_family_name) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.dual_state_family_name);

        = c$dual_state_password =
          IF field_header_p^.element_size <> #SIZE (system_label.dual_state_password) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.dual_state_password);

        = c$dual_state_project =
          IF field_header_p^.element_size <> #SIZE (system_label.dual_state_project) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.dual_state_project);

        = c$dual_state_user =
          IF field_header_p^.element_size <> #SIZE (system_label.dual_state_user) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.dual_state_user);

        = c$earliest_print_time =
          IF field_header_p^.element_size <> #SIZE (system_label.earliest_print_time) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.earliest_print_time);

        = c$external_characteristics =
          IF field_header_p^.element_size <> #SIZE (system_label.external_characteristics) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.external_characteristics);

        = c$file_position =
          IF field_header_p^.element_size <> #SIZE (system_label.file_position) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.file_position);

        = c$file_size =
          IF field_header_p^.element_size <> #SIZE (system_label.file_size) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.file_size);

        = c$forms_code =
          IF field_header_p^.element_size <> #SIZE (system_label.forms_code) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.forms_code);

        = c$implicit_routing_text =
          IF field_header_p^.element_size <> #SIZE (system_label.implicit_routing_text) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.implicit_routing_text);

        = c$latest_print_time =
          IF field_header_p^.element_size <> #SIZE (system_label.latest_print_time) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.latest_print_time);

        = c$login_account =
          IF field_header_p^.element_size <> #SIZE (system_label.login_account) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.login_account);

        = c$login_family =
          IF field_header_p^.element_size <> #SIZE (system_label.login_user_identification.family) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.login_user_identification.family);

        = c$login_project =
          IF field_header_p^.element_size <> #SIZE (system_label.login_project) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.login_project);

        = c$login_user =
          IF field_header_p^.element_size <> #SIZE (system_label.login_user_identification.user) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.login_user_identification.user);

        = c$originating_application_name =
          IF field_header_p^.element_size <> #SIZE (system_label.originating_application_name) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.originating_application_name);

        = c$output_class =
          IF field_header_p^.element_size <> #SIZE (system_label.output_class) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.output_class);

        = c$output_deferred_by_operator =
          IF field_header_p^.element_size <> #SIZE (system_label.output_deferred_by_operator) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.output_deferred_by_operator);

        = c$output_deferred_by_user =
          IF field_header_p^.element_size <> #SIZE (system_label.output_deferred_by_user) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.output_deferred_by_user);

        = c$output_destination =
          IF field_header_p^.element_size <> #SIZE (system_label.output_destination) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.output_destination);

        = c$output_destination_family =
          IF field_header_p^.element_size <> #SIZE (system_label.output_destination_family) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.output_destination_family);

        = c$output_destination_usage =
          IF field_header_p^.element_size <> #SIZE (system_label.output_destination_usage) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.output_destination_usage);

        = c$output_disposition_key =
          IF field_header_p^.element_size <> #SIZE (system_label.output_disposition_key) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.output_disposition_key);

        = c$output_disposition_time =
          IF field_header_p^.element_size <> #SIZE (system_label.output_disposition_time) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.output_disposition_time);

        = c$output_priority =
          IF field_header_p^.element_size <> #SIZE (system_label.output_priority) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.output_priority);

        = c$output_submission_time =
          IF field_header_p^.element_size <> #SIZE (system_label.output_submission_time) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.output_submission_time);

        = c$purge_delay =
          IF field_header_p^.element_size <> #SIZE (system_label.purge_delay) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.purge_delay);

        = c$remote_host_directive =
          IF field_header_p^.element_size <> #SIZE (system_label.remote_host_directive) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.remote_host_directive);

        = c$routing_banner =
          IF field_header_p^.element_size <> #SIZE (system_label.routing_banner) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.routing_banner);

        = c$site_information =
          IF field_header_p^.element_size <> #SIZE (system_label.site_information) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.site_information);

        = c$source_logical_id =
          IF field_header_p^.element_size <> #SIZE (system_label.source_logical_id) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.source_logical_id);

        = c$station =
          IF field_header_p^.element_size <> #SIZE (system_label.station) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.station);

        = c$station_operator =
          IF field_header_p^.element_size <> #SIZE (system_label.station_operator) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.station_operator);

        = c$system_file_name =
          IF field_header_p^.element_size <> #SIZE (system_label.system_file_name) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.system_file_name);

        = c$system_job_name =
          IF field_header_p^.element_size <> #SIZE (system_label.system_job_name) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.system_job_name);

        = c$system_routing_text =
          IF field_header_p^.element_size <> #SIZE (system_label.system_routing_text) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.system_routing_text);

        = c$user_file_name =
          IF field_header_p^.element_size <> #SIZE (system_label.user_file_name) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.user_file_name);

        = c$user_information =
          IF field_header_p^.element_size <> #SIZE (system_label.user_information) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.user_information);

        = c$user_job_name =
          IF field_header_p^.element_size <> #SIZE (system_label.user_job_name) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.user_job_name);

        = c$version =

{ Shouldn't ever happen, but just in case...

        = c$vertical_print_density =
          IF field_header_p^.element_size <> #SIZE (system_label.vertical_print_density) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.vertical_print_density);

        = c$vfu_load_procedure =
          IF field_header_p^.element_size <> #SIZE (system_label.vfu_load_procedure) THEN
            osp$set_status_condition (jme$read_output_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.vfu_load_procedure);

        ELSE

{ An unknown label element has been found.  The label must have been generated on
{ a predecessor system to the currently executing system.  Ignore unknown attributes.

        CASEND;

        NEXT field_header_p IN output_label_p;
      WHILEND;
    PROCEND unpack_standard_output_label;
?? OLDTITLE ??
?? EJECT ??

    status.normal := TRUE;

    fmp$get_jl_pointer (file_reference, {append} FALSE, output_label_p, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    RESET output_label_p;
    NEXT output_label_version_p IN output_label_p;
    IF output_label_version_p = NIL THEN
      osp$set_status_condition (jme$read_output_system_label, status);
      RETURN; {----->
    IFEND;

    IF output_label_version_p^ = old_output_system_label_version THEN
      unpack_old_output_label (output_label_p, system_label);
    ELSEIF output_label_version_p^ = new_output_system_label_version THEN
      unpack_standard_output_label (output_label_p, system_label, status);
    ELSE
      osp$set_status_condition (jme$sl_version_mismatch, status);
      RETURN; {----->
    IFEND;

  PROCEND qfp$read_output_system_label;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL, #GATE] qfp$read_qfile_system_label', EJECT ??
*copy qfh$read_qfile_system_label

  PROCEDURE [XDCL, #GATE] qfp$read_qfile_system_label
    (    file_reference: fst$file_reference;
     VAR system_label: jmt$qfile_system_label;
     VAR status: ost$status);

    VAR
      qfile_label_p: ^SEQ ( * );

?? NEWTITLE := 'unpack_standard_qfile_label', EJECT ??

    PROCEDURE unpack_standard_qfile_label
      (VAR qfile_label_p {input} : ^SEQ ( * );
       VAR system_label: jmt$qfile_system_label;
       VAR status: ost$status);

      VAR
        element_p: ^string ( * <= c$maximum_element_size),
        field_header_p: ^t$label_element_header;

      status.normal := TRUE;

{The following fields were added in L871AACC and have to be initialized by default values
{in case we process an older label.
      system_label.deferred_by_operator := FALSE;
      system_label.deferred_by_user := FALSE;
      system_label.login_user_identification.user := jmc$system_user;
      system_label.login_user_identification.family := jmc$system_family;
      system_label.qfile_controller.user := jmc$system_user;
      system_label.qfile_controller.family := jmc$system_family;
      system_label.application_status.normal := TRUE;
      system_label.application_status.condition := 0;
      system_label.application_status.text.size := 0;
      system_label.application_status.text.value := '';

      NEXT field_header_p IN qfile_label_p;
      WHILE field_header_p <> NIL DO
        IF field_header_p^.element_size > 0 THEN
          NEXT element_p: [field_header_p^.element_size] IN qfile_label_p;
          IF element_p = NIL THEN
            osp$set_status_condition (jme$read_qfile_system_label, status);
            RETURN; {----->
          IFEND;
        ELSE
          element_p := NIL;
        IFEND;

        CASE field_header_p^.element_identifier OF
        = c$application_name =
          IF field_header_p^.element_size <> #SIZE (system_label.application_name) THEN
            osp$set_status_condition (jme$read_qfile_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.application_name);

        = c$application_status =
          IF field_header_p^.element_size <> #SIZE (system_label.application_status) THEN
            osp$set_status_condition (jme$read_qfile_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.application_status);

        = c$control_family =
          IF field_header_p^.element_size <> #SIZE (system_label.qfile_controller.family) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.qfile_controller.family);

        = c$control_user =
          IF field_header_p^.element_size <> #SIZE (system_label.qfile_controller.user) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.qfile_controller.user);

        = c$data_mode =
          IF field_header_p^.element_size <> #SIZE (system_label.data_mode) THEN
            osp$set_status_condition (jme$read_qfile_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.data_mode);

        = c$deferred_by_application =
          IF field_header_p^.element_size <> #SIZE (system_label.deferred_by_application) THEN
            osp$set_status_condition (jme$read_qfile_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.deferred_by_application);

        = c$deferred_by_operator =
          IF field_header_p^.element_size <> #SIZE (system_label.deferred_by_operator) THEN
            osp$set_status_condition (jme$read_qfile_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.deferred_by_operator);

        = c$deferred_by_user =
          IF field_header_p^.element_size <> #SIZE (system_label.deferred_by_user) THEN
            osp$set_status_condition (jme$read_qfile_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.deferred_by_user);

        = c$destination =
          IF field_header_p^.element_size <> #SIZE (system_label.destination) THEN
            osp$set_status_condition (jme$read_qfile_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.destination);

        = c$disposition_time =
          IF field_header_p^.element_size <> #SIZE (system_label.disposition_time) THEN
            osp$set_status_condition (jme$read_qfile_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.disposition_time);

        = c$earliest_run_time =
          IF field_header_p^.element_size <> #SIZE (system_label.earliest_run_time) THEN
            osp$set_status_condition (jme$read_qfile_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.earliest_run_time);

        = c$latest_run_time =
          IF field_header_p^.element_size <> #SIZE (system_label.latest_run_time) THEN
            osp$set_status_condition (jme$read_qfile_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.latest_run_time);

        = c$login_family =
          IF field_header_p^.element_size <> #SIZE (system_label.login_user_identification.family) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.login_user_identification.family);

        = c$login_user =
          IF field_header_p^.element_size <> #SIZE (system_label.login_user_identification.user) THEN
            osp$set_status_condition (jme$read_job_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.login_user_identification.user);

        = c$purge_delay =
          IF field_header_p^.element_size <> #SIZE (system_label.purge_delay) THEN
            osp$set_status_condition (jme$read_qfile_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.purge_delay);

        = c$remote_host_directive =
          IF field_header_p^.element_size <> #SIZE (system_label.remote_host_directive) THEN
            osp$set_status_condition (jme$read_qfile_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.remote_host_directive);

        = c$system_file_name =
          IF field_header_p^.element_size <> #SIZE (system_label.system_file_name) THEN
            osp$set_status_condition (jme$read_qfile_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.system_file_name);

        = c$application_attributes =

{ The actual size of the application attributes may be <= the size of the type defined
{ in the system label.

          IF field_header_p^.element_size > #SIZE (system_label.application_attributes) THEN
            osp$set_status_condition (jme$read_qfile_system_label, status);
            RETURN; {----->
          IFEND;
          #UNCHECKED_CONVERSION (element_p^, system_label.application_attributes);

        ELSE

{ An unknown label element has been found.  The label must have been generated on
{ a predecessor system to the currently executing system.  Ignore unknown attributes.

        CASEND;

        NEXT field_header_p IN qfile_label_p;
      WHILEND;

    PROCEND unpack_standard_qfile_label;
?? OLDTITLE ??
?? EJECT ??
    status.normal := TRUE;

    fmp$get_jl_pointer (file_reference, {append} FALSE, qfile_label_p, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    RESET qfile_label_p;
    unpack_standard_qfile_label (qfile_label_p, system_label, status);

  PROCEND qfp$read_qfile_system_label;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL, #GATE] qfp$write_job_system_label', EJECT ??
*copy qfh$write_job_system_label

  PROCEDURE [XDCL, #GATE] qfp$write_job_system_label
    (    file_reference: fst$file_reference;
         write_label: boolean;
         system_label: jmt$job_system_label;
     VAR status: ost$status);

    VAR
      job_label_p: ^SEQ ( * );

?? NEWTITLE := 'pack_standard_job_label', EJECT ??

    PROCEDURE pack_standard_job_label
      (    system_label: jmt$job_system_label;
       VAR job_label_p {input, output} : ^SEQ ( * );
       VAR status: ost$status);

      VAR
        element_p: ^string ( * <= c$maximum_element_size),
        field_header_p: ^t$label_element_header,
        job_label_version_p: ^jmt$job_system_label_version;

?? NEWTITLE := '[INLINE] add_element_to_label', EJECT ??

{ NOTE:
{   The variable field_header_p is declared in the enclosing procedure for
{   performance reasons.  If it were placed in the add_element_to_label procedure
{   the dynamic space pointer (DSP) would be increased every time the inline
{   was called.


      PROCEDURE [INLINE] add_element_to_label
        (    element_identifier: t$element_identifier;
             element_size: t$element_size;
         VAR element_p: ^string ( * <= c$maximum_element_size);
         VAR status: ost$status);

        NEXT field_header_p IN job_label_p;
        IF field_header_p = NIL THEN
          osp$set_status_condition (jme$write_job_system_label, status);
          RETURN; {----->
        IFEND;
        field_header_p^.element_size := element_size;
        field_header_p^.element_identifier := element_identifier;
        IF element_size > 0 THEN
          NEXT element_p: [element_size] IN job_label_p;
          IF element_p = NIL THEN
            osp$set_status_condition (jme$write_job_system_label, status);
            RETURN; {----->
          IFEND;
        ELSE
          element_p := NIL;
        IFEND;
      PROCEND add_element_to_label;
?? OLDTITLE ??
?? EJECT ??

      status.normal := TRUE;
      field_header_p := NIL;

      RESET job_label_p;
      NEXT job_label_version_p IN job_label_p;
      IF job_label_version_p = NIL THEN
        osp$set_status_condition (jme$write_job_system_label, status);
        RETURN; {----->
      IFEND;
      job_label_version_p^ := new_job_system_label_version;

      add_element_to_label (c$active_profile_version, #SIZE (system_label.active_profile_version), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.active_profile_version, element_p^);

      add_element_to_label (c$assigned_job_class, #SIZE (system_label.assigned_job_class), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.assigned_job_class, element_p^);

      add_element_to_label (c$comment_banner, #SIZE (system_label.job_attributes.comment_banner), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.comment_banner, element_p^);

      add_element_to_label (c$control_family, #SIZE (system_label.job_attributes.job_controller.family),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.job_controller.family, element_p^);

      add_element_to_label (c$control_user, #SIZE (system_label.job_attributes.job_controller.user),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.job_controller.user, element_p^);

      add_element_to_label (c$copy_count, #SIZE (system_label.job_attributes.copy_count), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.copy_count, element_p^);

      add_element_to_label (c$cpu_time_limit_assigned, #SIZE (system_label.limit_information.
            cpu_time_limit_assigned), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.limit_information.cpu_time_limit_assigned, element_p^);

      add_element_to_label (c$cpu_time_limit_requested, #SIZE (system_label.limit_information.
            cpu_time_limit_requested), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.limit_information.cpu_time_limit_requested, element_p^);

      add_element_to_label (c$cpu_time_limit_specified, #SIZE (system_label.limit_information.
            cpu_time_limit_specified), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.limit_information.cpu_time_limit_specified, element_p^);

      add_element_to_label (c$data_declaration, #SIZE (system_label.data_declaration), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.data_declaration, element_p^);

      add_element_to_label (c$data_mode, #SIZE (system_label.data_mode), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.data_mode, element_p^);

      add_element_to_label (c$device, #SIZE (system_label.job_attributes.device), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.device, element_p^);

      add_element_to_label (c$disposition_code, #SIZE (system_label.disposition_code), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.disposition_code, element_p^);

      add_element_to_label (c$earliest_print_time, #SIZE (system_label.job_attributes.earliest_print_time),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.earliest_print_time, element_p^);

      add_element_to_label (c$earliest_run_time, #SIZE (system_label.job_attributes.earliest_run_time),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.earliest_run_time, element_p^);

      add_element_to_label (c$external_characteristics, #SIZE (system_label.job_attributes.
            external_characteristics), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.external_characteristics, element_p^);

      add_element_to_label (c$file_size, #SIZE (system_label.job_attributes.job_size), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.job_size, element_p^);

      add_element_to_label (c$forms_code, #SIZE (system_label.job_attributes.forms_code), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.forms_code, element_p^);

      add_element_to_label (c$implicit_routing_text, #SIZE (system_label.job_attributes.
            implicit_routing_text), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.implicit_routing_text, element_p^);

      add_element_to_label (c$job_abort_disposition, #SIZE (system_label.job_abort_disposition), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_abort_disposition, element_p^);

      add_element_to_label (c$job_category_set, #SIZE (system_label.job_category_set), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_category_set, element_p^);

      add_element_to_label (c$job_class_name, #SIZE (system_label.job_class_name), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_class_name, element_p^);

      add_element_to_label (c$job_deferred_by_operator, #SIZE (system_label.job_deferred_by_operator),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_deferred_by_operator, element_p^);

      add_element_to_label (c$job_deferred_by_user, #SIZE (system_label.job_deferred_by_user), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_deferred_by_user, element_p^);

      add_element_to_label (c$job_destination_family, #SIZE (system_label.job_destination_family), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_destination_family, element_p^);

      add_element_to_label (c$job_destination_usage, #SIZE (system_label.job_destination_usage), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_destination_usage, element_p^);

      add_element_to_label (c$job_execution_ring, #SIZE (system_label.job_execution_ring), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_execution_ring, element_p^);

      add_element_to_label (c$job_initiation_location, #SIZE (system_label.job_initiation_location),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_initiation_location, element_p^);

      add_element_to_label (c$job_initiation_time, #SIZE (system_label.job_attributes.job_initiation_time),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.job_initiation_time, element_p^);

      add_element_to_label (c$job_input_device, #SIZE (system_label.job_attributes.job_input_device),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.job_input_device, element_p^);

      add_element_to_label (c$job_mode, #SIZE (system_label.job_mode), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_mode, element_p^);

      add_element_to_label (c$job_priority, #SIZE (system_label.job_priority), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_priority, element_p^);

      add_element_to_label (c$job_qualifier_list, #SIZE (system_label.job_attributes.job_qualifier_list),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.job_qualifier_list, element_p^);

      add_element_to_label (c$job_recovery_disposition, #SIZE (system_label.job_recovery_disposition),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_recovery_disposition, element_p^);

      add_element_to_label (c$job_submission_time, #SIZE (system_label.job_attributes.job_submission_time),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.job_submission_time, element_p^);

      add_element_to_label (c$latest_print_time, #SIZE (system_label.job_attributes.latest_print_time),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.latest_print_time, element_p^);

      add_element_to_label (c$latest_run_time, #SIZE (system_label.job_attributes.latest_run_time), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.latest_run_time, element_p^);

      add_element_to_label (c$login_account, #SIZE (system_label.login_account), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.login_account, element_p^);

      add_element_to_label (c$login_command_supplied, #SIZE (system_label.job_attributes.
            login_command_supplied), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.login_command_supplied, element_p^);

      add_element_to_label (c$login_family, #SIZE (system_label.login_user_identification.family), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.login_user_identification.family, element_p^);

      add_element_to_label (c$login_password, #SIZE (system_label.login_password), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.login_password, element_p^);

      add_element_to_label (c$login_project, #SIZE (system_label.login_project), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.login_project, element_p^);

      add_element_to_label (c$login_user, #SIZE (system_label.login_user_identification.user), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.login_user_identification.user, element_p^);

      add_element_to_label (c$magnetic_tape_limit_assigned,
            #SIZE (system_label.limit_information.magnetic_tape_limit_assigned), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.limit_information.magnetic_tape_limit_assigned, element_p^);

      add_element_to_label (c$magnetic_tape_limit_requested,
            #SIZE (system_label.limit_information.magnetic_tape_limit_requested), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.limit_information.magnetic_tape_limit_requested, element_p^);

      add_element_to_label (c$magnetic_tape_limit_specified,
            #SIZE (system_label.limit_information.magnetic_tape_limit_specified), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.limit_information.magnetic_tape_limit_specified, element_p^);

      add_element_to_label (c$maximum_working_set_assigned,
            #SIZE (system_label.limit_information.maximum_working_set_assigned), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.limit_information.maximum_working_set_assigned, element_p^);

      add_element_to_label (c$maximum_working_set_requested,
            #SIZE (system_label.limit_information.maximum_working_set_requested), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.limit_information.maximum_working_set_requested, element_p^);

      add_element_to_label (c$maximum_working_set_specified,
            #SIZE (system_label.limit_information.maximum_working_set_specified), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.limit_information.maximum_working_set_specified, element_p^);

      add_element_to_label (c$optional_user_capability, #SIZE (system_label.optional_user_capability),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.optional_user_capability, element_p^);

      add_element_to_label (c$originating_application_name,
            #SIZE (system_label.job_attributes.originating_application_name), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.originating_application_name, element_p^);

      add_element_to_label (c$originating_login_account, #SIZE (system_label.originating_login_account),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.originating_login_account, element_p^);

      add_element_to_label (c$originating_login_family, #SIZE (system_label.originating_login_family),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.originating_login_family, element_p^);

      add_element_to_label (c$originating_login_project, #SIZE (system_label.originating_login_project),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.originating_login_project, element_p^);

      add_element_to_label (c$originating_login_user, #SIZE (system_label.originating_login_user), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.originating_login_user, element_p^);

      add_element_to_label (c$originating_ssn, #SIZE (system_label.job_attributes.originating_ssn), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.originating_ssn, element_p^);

      add_element_to_label (c$output_class, #SIZE (system_label.job_attributes.output_class), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.output_class, element_p^);

      add_element_to_label (c$output_deferred_by_user, #SIZE (system_label.job_attributes.
            output_deferred_by_user), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.output_deferred_by_user, element_p^);

      add_element_to_label (c$output_destination, #SIZE (system_label.job_attributes.output_destination),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.output_destination, element_p^);

      add_element_to_label (c$output_destination_family, #SIZE (system_label.job_attributes.
            output_destination_family), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.output_destination_family, element_p^);

      add_element_to_label (c$output_destination_usage, #SIZE (system_label.job_attributes.
            output_destination_usage), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.output_destination_usage, element_p^);

      add_element_to_label (c$output_disposition_key, #SIZE (system_label.job_attributes.
            output_disposition_key), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.output_disposition_key, element_p^);

      add_element_to_label (c$output_disposition_path, #SIZE (system_label.job_attributes.
            output_disposition_path), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.output_disposition_path, element_p^);

      add_element_to_label (c$output_priority, #SIZE (system_label.job_attributes.output_priority), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.output_priority, element_p^);

      add_element_to_label (c$perform_class_validation, #SIZE (system_label.perform_class_validation),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.perform_class_validation, element_p^);

      add_element_to_label (c$process_user_prolog_epilog, #SIZE (system_label.job_attributes.
            process_user_prolog_and_epilog), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.process_user_prolog_and_epilog, element_p^);

      add_element_to_label (c$purge_delay, #SIZE (system_label.job_attributes.purge_delay), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.purge_delay, element_p^);

      add_element_to_label (c$remote_host_directive, #SIZE (system_label.job_attributes.
            remote_host_directive), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.remote_host_directive, element_p^);

      add_element_to_label (c$required_user_capability, #SIZE (system_label.required_user_capability),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.required_user_capability, element_p^);

      add_element_to_label (c$routing_banner, #SIZE (system_label.job_attributes.routing_banner), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.routing_banner, element_p^);

      add_element_to_label (c$site_information, #SIZE (system_label.job_attributes.site_information),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.site_information, element_p^);

      add_element_to_label (c$source_logical_id, #SIZE (system_label.job_attributes.source_logical_id),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.source_logical_id, element_p^);

      add_element_to_label (c$sru_limit_assigned, #SIZE (system_label.limit_information.sru_limit_assigned),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.limit_information.sru_limit_assigned, element_p^);

      add_element_to_label (c$sru_limit_requested, #SIZE (system_label.limit_information.sru_limit_requested),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.limit_information.sru_limit_requested, element_p^);

      add_element_to_label (c$sru_limit_specified, #SIZE (system_label.limit_information.sru_limit_specified),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.limit_information.sru_limit_specified, element_p^);

      add_element_to_label (c$station, #SIZE (system_label.job_attributes.station), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.station, element_p^);

      add_element_to_label (c$station_operator, #SIZE (system_label.job_attributes.station_operator),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.station_operator, element_p^);

      add_element_to_label (c$system_job_name, #SIZE (system_label.system_job_name), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.system_job_name, element_p^);

      add_element_to_label (c$system_job_parameters, #SIZE (system_label.job_attributes.
            system_job_parameters), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.system_job_parameters, element_p^);

      add_element_to_label (c$system_routing_text, #SIZE (system_label.job_attributes.system_routing_text),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.system_routing_text, element_p^);

      add_element_to_label (c$user_information, #SIZE (system_label.job_attributes.user_information),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.user_information, element_p^);

      add_element_to_label (c$user_job_name, #SIZE (system_label.user_job_name), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.user_job_name, element_p^);

      add_element_to_label (c$vertical_print_density, #SIZE (system_label.job_attributes.
            vertical_print_density), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.vertical_print_density, element_p^);

      add_element_to_label (c$vfu_load_procedure, #SIZE (system_label.job_attributes.vfu_load_procedure),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.job_attributes.vfu_load_procedure, element_p^);

    PROCEND pack_standard_job_label;
?? OLDTITLE ??
?? EJECT ??
    status.normal := TRUE;

    fmp$get_jl_pointer (file_reference, {append} TRUE, job_label_p, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    pack_standard_job_label (system_label, job_label_p, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    fmp$put_jl_pointer (file_reference, write_label, job_label_p, status);
  PROCEND qfp$write_job_system_label;
?? OLDTITLE ??
?? NEWTITLE := '[XDCL, #GATE] qfp$write_output_system_label', EJECT ??
*copy qfh$write_output_system_label

  PROCEDURE [XDCL, #GATE] qfp$write_output_system_label
    (    file_reference: fst$file_reference;
         write_label: boolean;
         system_label: jmt$output_system_label;
     VAR status: ost$status);

    VAR
      output_label_p: ^SEQ ( * );

?? NEWTITLE := 'pack_standard_output_label', EJECT ??

    PROCEDURE pack_standard_output_label
      (    system_label: jmt$output_system_label;
       VAR output_label_p {input} : ^SEQ ( * );
       VAR status: ost$status);

      VAR
        element_p: ^string ( * <= c$maximum_element_size),
        field_header_p: ^t$label_element_header,
        output_label_version_p: ^jmt$output_system_label_version;

?? NEWTITLE := '[INLINE] add_element_to_label', EJECT ??

{ NOTE:
{   The variable field_header_p is declared in the enclosing procedure for
{   performance reasons.  If it were placed in the add_element_to_label procedure
{   the dynamic space pointer (DSP) would be increased every time the inline
{   was called.

      PROCEDURE [INLINE] add_element_to_label
        (    element_identifier: t$element_identifier;
             element_size: t$element_size;
         VAR element_p: ^string ( * <= c$maximum_element_size);
         VAR status: ost$status);

        NEXT field_header_p IN output_label_p;
        IF field_header_p = NIL THEN
          osp$set_status_condition (jme$write_output_system_label, status);
          RETURN; {----->
        IFEND;
        field_header_p^.element_size := element_size;
        field_header_p^.element_identifier := element_identifier;
        IF element_size > 0 THEN
          NEXT element_p: [element_size] IN output_label_p;
          IF element_p = NIL THEN
            osp$set_status_condition (jme$write_output_system_label, status);
            RETURN; {----->
          IFEND;
        ELSE
          element_p := NIL;
        IFEND;
      PROCEND add_element_to_label;
?? OLDTITLE ??
?? EJECT ??

      status.normal := TRUE;

      RESET output_label_p;
      NEXT output_label_version_p IN output_label_p;
      IF output_label_version_p = NIL THEN
        osp$set_status_condition (jme$write_output_system_label, status);
        RETURN; {----->
      IFEND;
      output_label_version_p^ := new_output_system_label_version;

      add_element_to_label (c$comment_banner, #SIZE (system_label.comment_banner), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.comment_banner, element_p^);

      add_element_to_label (c$control_family, #SIZE (system_label.output_controller.family), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.output_controller.family, element_p^);

      add_element_to_label (c$control_user, #SIZE (system_label.output_controller.user), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.output_controller.user, element_p^);

      add_element_to_label (c$copies_printed, #SIZE (system_label.copies_printed), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.copies_printed, element_p^);

      add_element_to_label (c$copy_count, #SIZE (system_label.copy_count), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.copy_count, element_p^);

      add_element_to_label (c$data_declaration, #SIZE (system_label.data_declaration), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.data_declaration, element_p^);

      add_element_to_label (c$data_mode, #SIZE (system_label.data_mode), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.data_mode, element_p^);

      add_element_to_label (c$device, #SIZE (system_label.device), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.device, element_p^);

      add_element_to_label (c$device_type, #SIZE (system_label.device_type), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.device_type, element_p^);

      add_element_to_label (c$disposition_code, #SIZE (system_label.disposition_code), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.disposition_code, element_p^);

      add_element_to_label (c$dual_state_account, #SIZE (system_label.dual_state_account), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.dual_state_account, element_p^);

      add_element_to_label (c$dual_state_family, #SIZE (system_label.dual_state_family_name), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.dual_state_family_name, element_p^);

      add_element_to_label (c$dual_state_password, #SIZE (system_label.dual_state_password), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.dual_state_password, element_p^);

      add_element_to_label (c$dual_state_project, #SIZE (system_label.dual_state_project), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.dual_state_project, element_p^);

      add_element_to_label (c$dual_state_user, #SIZE (system_label.dual_state_user), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.dual_state_user, element_p^);

      add_element_to_label (c$earliest_print_time, #SIZE (system_label.earliest_print_time), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.earliest_print_time, element_p^);

      add_element_to_label (c$external_characteristics, #SIZE (system_label.external_characteristics),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.external_characteristics, element_p^);

      add_element_to_label (c$file_position, #SIZE (system_label.file_position), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.file_position, element_p^);

      add_element_to_label (c$file_size, #SIZE (system_label.file_size), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.file_size, element_p^);

      add_element_to_label (c$forms_code, #SIZE (system_label.forms_code), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.forms_code, element_p^);

      add_element_to_label (c$implicit_routing_text, #SIZE (system_label.implicit_routing_text), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.implicit_routing_text, element_p^);

      add_element_to_label (c$latest_print_time, #SIZE (system_label.latest_print_time), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.latest_print_time, element_p^);

      add_element_to_label (c$login_account, #SIZE (system_label.login_account), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.login_account, element_p^);

      add_element_to_label (c$login_family, #SIZE (system_label.login_user_identification.family), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.login_user_identification.family, element_p^);

      add_element_to_label (c$login_project, #SIZE (system_label.login_project), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.login_project, element_p^);

      add_element_to_label (c$login_user, #SIZE (system_label.login_user_identification.user), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.login_user_identification.user, element_p^);

      add_element_to_label (c$originating_application_name, #SIZE (system_label.originating_application_name),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.originating_application_name, element_p^);

      add_element_to_label (c$output_class, #SIZE (system_label.output_class), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.output_class, element_p^);

      add_element_to_label (c$output_deferred_by_operator, #SIZE (system_label.output_deferred_by_operator),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.output_deferred_by_operator, element_p^);

      add_element_to_label (c$output_deferred_by_user, #SIZE (system_label.output_deferred_by_user),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.output_deferred_by_user, element_p^);

      add_element_to_label (c$output_destination, #SIZE (system_label.output_destination), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.output_destination, element_p^);

      add_element_to_label (c$output_destination_family, #SIZE (system_label.output_destination_family),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.output_destination_family, element_p^);

      add_element_to_label (c$output_destination_usage, #SIZE (system_label.output_destination_usage),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.output_destination_usage, element_p^);

      add_element_to_label (c$output_disposition_key, #SIZE (system_label.output_disposition_key), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.output_disposition_key, element_p^);

      add_element_to_label (c$output_disposition_time, #SIZE (system_label.output_disposition_time),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.output_disposition_time, element_p^);

      add_element_to_label (c$output_priority, #SIZE (system_label.output_priority), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.output_priority, element_p^);

      add_element_to_label (c$output_submission_time, #SIZE (system_label.output_submission_time), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.output_submission_time, element_p^);

      add_element_to_label (c$purge_delay, #SIZE (system_label.purge_delay), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.purge_delay, element_p^);

      add_element_to_label (c$remote_host_directive, #SIZE (system_label.remote_host_directive), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.remote_host_directive, element_p^);

      add_element_to_label (c$routing_banner, #SIZE (system_label.routing_banner), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.routing_banner, element_p^);

      add_element_to_label (c$site_information, #SIZE (system_label.site_information), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.site_information, element_p^);

      add_element_to_label (c$source_logical_id, #SIZE (system_label.source_logical_id), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.source_logical_id, element_p^);

      add_element_to_label (c$station, #SIZE (system_label.station), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.station, element_p^);

      add_element_to_label (c$station_operator, #SIZE (system_label.station_operator), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.station_operator, element_p^);

      add_element_to_label (c$system_file_name, #SIZE (system_label.system_file_name), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.system_file_name, element_p^);

      add_element_to_label (c$system_job_name, #SIZE (system_label.system_job_name), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.system_job_name, element_p^);

      add_element_to_label (c$system_routing_text, #SIZE (system_label.system_routing_text), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.system_routing_text, element_p^);

      add_element_to_label (c$user_file_name, #SIZE (system_label.user_file_name), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.user_file_name, element_p^);

      add_element_to_label (c$user_information, #SIZE (system_label.user_information), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.user_information, element_p^);

      add_element_to_label (c$user_job_name, #SIZE (system_label.user_job_name), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.user_job_name, element_p^);

      add_element_to_label (c$vertical_print_density, #SIZE (system_label.vertical_print_density), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.vertical_print_density, element_p^);

      add_element_to_label (c$vfu_load_procedure, #SIZE (system_label.vfu_load_procedure), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.vfu_load_procedure, element_p^);

    PROCEND pack_standard_output_label;
?? OLDTITLE ??
?? EJECT ??
    status.normal := TRUE;

    fmp$get_jl_pointer (file_reference, {append} TRUE, output_label_p, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    pack_standard_output_label (system_label, output_label_p, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    fmp$put_jl_pointer (file_reference, write_label, output_label_p, status);
  PROCEND qfp$write_output_system_label;
?? NEWTITLE := '[XDCL, #GATE] qfp$write_qfile_system_label', EJECT ??
*copy qfh$write_qfile_system_label

  PROCEDURE [XDCL, #GATE] qfp$write_qfile_system_label
    (    file_reference: fst$file_reference;
         write_label: boolean;
         system_label: jmt$qfile_system_label;
         application_attributes_size: jmt$qsl_appl_attr_contents_size;
     VAR status: ost$status);

    VAR
      qfile_label_p: ^SEQ ( * );

?? NEWTITLE := 'pack_standard_qfile_label', EJECT ??

    PROCEDURE pack_standard_qfile_label
      (    system_label: jmt$qfile_system_label;
           application_attributes_size: jmt$qfile_appl_attr_size;
       VAR qfile_label_p {input} : ^SEQ ( * );
       VAR status: ost$status);

      VAR
        element_p: ^string ( * <= c$maximum_element_size),
        field_header_p: ^t$label_element_header;

?? NEWTITLE := '[INLINE] add_element_to_label', EJECT ??

{ NOTE:
{   The variable field_header_p is declared in the enclosing procedure for
{   performance reasons.  If it were placed in the add_element_to_label procedure
{   the dynamic space pointer (DSP) would be increased every time the inline
{   was called.

      PROCEDURE [INLINE] add_element_to_label
        (    element_identifier: t$element_identifier;
             element_size: t$element_size;
         VAR element_p: ^string ( * <= c$maximum_element_size);
         VAR status: ost$status);

        NEXT field_header_p IN qfile_label_p;
        IF field_header_p = NIL THEN
          osp$set_status_condition (jme$write_qfile_system_label, status);
          RETURN; {----->
        IFEND;
        field_header_p^.element_size := element_size;
        field_header_p^.element_identifier := element_identifier;
        IF element_size > 0 THEN
          NEXT element_p: [element_size] IN qfile_label_p;
          IF element_p = NIL THEN
            osp$set_status_condition (jme$write_qfile_system_label, status);
            RETURN; {----->
          IFEND;
        ELSE
          element_p := NIL;
        IFEND;
      PROCEND add_element_to_label;
?? OLDTITLE ??
?? EJECT ??

      status.normal := TRUE;

      RESET qfile_label_p;

{c$control_family
      add_element_to_label (c$control_family, #SIZE (system_label.qfile_controller.family), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.qfile_controller.family, element_p^);

{c$control_user
      add_element_to_label (c$login_user, #SIZE (system_label.qfile_controller.user), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.qfile_controller.user, element_p^);

{c$data_mode
      add_element_to_label (c$data_mode, #SIZE (system_label.data_mode), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.data_mode, element_p^);

{c$deferred_by_application
      add_element_to_label (c$deferred_by_application, #SIZE (system_label.deferred_by_application),
            element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.deferred_by_application, element_p^);

{c$deferred_by_operator
      add_element_to_label (c$deferred_by_operator, #SIZE (system_label.deferred_by_operator), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.deferred_by_operator, element_p^);

{c$deferred_by_user
      add_element_to_label (c$deferred_by_user, #SIZE (system_label.deferred_by_user), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.deferred_by_user, element_p^);

{c$destination
      add_element_to_label (c$destination, #SIZE (system_label.destination), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.destination, element_p^);

{c$disposition_time
      add_element_to_label (c$disposition_time, #SIZE (system_label.disposition_time), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.disposition_time, element_p^);

{c$earliest_run_time
      add_element_to_label (c$earliest_run_time, #SIZE (system_label.earliest_run_time), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.earliest_run_time, element_p^);

{c$latest_run_time
      add_element_to_label (c$latest_run_time, #SIZE (system_label.latest_run_time), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.latest_run_time, element_p^);

{c$login_family
      add_element_to_label (c$login_family, #SIZE (system_label.login_user_identification.family), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.login_user_identification.family, element_p^);

{c$login_user
      add_element_to_label (c$login_user, #SIZE (system_label.login_user_identification.user), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.login_user_identification.user, element_p^);

{c$application_name
      add_element_to_label (c$application_name, #SIZE (system_label.application_name), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.application_name, element_p^);

{c$purge_delay
      add_element_to_label (c$purge_delay, #SIZE (system_label.purge_delay), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.purge_delay, element_p^);

{c$remote_host_directive
      add_element_to_label (c$remote_host_directive, #SIZE (system_label.remote_host_directive), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.remote_host_directive, element_p^);

{c$system_file_name
      add_element_to_label (c$system_file_name, #SIZE (system_label.system_file_name), element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.system_file_name, element_p^);

{c$application_status
      add_element_to_label (c$application_status, #SIZE (system_label.application_status), element_p,
            status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.application_status, element_p^);

{c$application_attributes
      add_element_to_label (c$application_attributes, application_attributes_size, element_p, status);
      IF NOT status.normal THEN
        RETURN; {----->
      IFEND;
      #UNCHECKED_CONVERSION (system_label.application_attributes, element_p^);

    PROCEND pack_standard_qfile_label;
?? OLDTITLE ??
?? EJECT ??
    status.normal := TRUE;

    fmp$get_jl_pointer (file_reference, {append} TRUE, qfile_label_p, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    RESET qfile_label_p;

    pack_standard_qfile_label (system_label, application_attributes_size, qfile_label_p, status);
    IF NOT status.normal THEN
      RETURN; {----->
    IFEND;

    fmp$put_jl_pointer (file_reference, write_label, qfile_label_p, status);
  PROCEND qfp$write_qfile_system_label;
?? OLDTITLE ??
MODEND jmm$system_label_access;
