Return to the RPG Tips
Using BIF's on D-Specs
You can specify some ILE built-in functions (BIFs) on D-specs, provided the compiler can evaluate all the BIF's parameters at compile time. For example, to define an array that overlays a character string, you can use the code below:D DS D string 10A D array 1A overlay(string) D dim(%size(string))This technique can also be useful when you're initializing variables:D codes C 'VXZF' D code_ext C 2 D attr1 S 1A inz(%subst(codes:code_ext:1))You can even nest BIFs in D-specs. For instance, the above example can be rewritten as:D attr2 S 1A inz(%subst(codes:code_ext: D %size(attr2)))by Hans Boldt (IBM)[report a broken link by clicking here]