Loading

Equivalent functionality for REDEFINES in Easytrieve

have you already read Easytrieve Variable declaration?

In COBOL, REDEFINES verb can be used to declare variables that share a same memory location.
In Easytrieve also, there is a similar functionality.
For example, the ALPHA and NUMERIC variables given below share the same 5 bytes.

 WS-ALPHA   W        5 A
 WS-NUMERIC WS-ALPHA 5 N

Since the starting position for WS-NUMERIC is given as WS-ALPHA, both of them start from the same memory location.

In case, if you want the same functionality in a File variable,

 FILE INFILE
 IN-REC   1 80 A
 IN-ALPHA     1  5 A
 IN-NUMERIC   1  5 N
 FILLER       6 75 A

Related Posts




blog comments powered by Disqus

There's 6 Comments So Far

Share your thoughts, leave a comment!