Getting Started with TRANSACT (32247-90007)
Chapter 6 97
Data Structures
Figure 6-3. Comparable PASCAL Data Structures
NO and ENTER are reserved words in COBOL. These variable names would have to be
changed, but that is unimportant to our discussion.
The Pascal example is not exactly the same as the Transact or COBOL example, since
Pascal does not have the direct equivalent of an ASCII numeric data type as COBOL and
Transact do. However, that is not important. The important part is being able to compare
how storage is reserved and how access is gained to it.
In Transact, an item is defined one time. This definition is either done using a data
dictionary or within the program. In either case, when space is reserved for the item, the
definition part is not included as it is for COBOL and Pascal.
1 const yes=1;
2 no=0;
3 enter=0;
4 type small_int=-32768..32767;
5 char2=packed array[1..2] of char;
6 char4=packed array[1..4] of char;
7 char6=packed array[1..6] of char;
8 char8=packed array[1..8] of char;
9 typ_vorderhead=record
10 order_no:char8;
11 cust_no:char4;
12 order_status:char2;
13 order_date:char6;
14 end;
15 typ_vorderline=record
16 line_no:char2;
17 part_number:char8;
18 quantity:integer;
19 end;
20 var valid:small_int;
21 lastkey:small_int;
22 ws_vorderhead:typ_vorderhead;
23 ws_vorderline:typ_vorderline;