Skip to content

Data Structures

danlong005 edited this page Aug 30, 2026 · 2 revisions

Data Structures

Basic Data Structure

DCL-DS employee QUALIFIED;
  id INT(10);
  name VARCHAR(50);
  salary PACKED(9:2);
END-DS;

employee.id = 1;
employee.name = 'Alice';
employee.salary = 75000.00;
DSPLY employee.name;

Array of Data Structures

DCL-DS item QUALIFIED DIM(10);
  code CHAR(5);
  description VARCHAR(50);
  price PACKED(7:2);
END-DS;

item(1).code = 'A001';
item(1).description = 'Widget';
item(1).price = 9.99;

LIKEDS

DCL-DS address QUALIFIED;
  street VARCHAR(100);
  city VARCHAR(50);
  state CHAR(2);
END-DS;

DCL-DS shipping LIKEDS(address);
shipping.city = 'Springfield';

Clone this wiki locally