CL Programming

Changing and Retrieving a Data Area Example

The following is an example of using the CHGDTAARA and RTVDTAARA commands for character substring operations.

This example:

To do this, the following commands would be entered:

DCL VAR(&CLVAR1) TYPE(*CHAR) LEN(5)
.
CRTDTAARA DTAARA(MYLIB/DA1) TYPE(*CHAR) LEN(10) +
     VALUE('ABCD5678IJ')
.
.
.
CHGDTAARA DTAARA((MYLIB/DA1) (5 4)) VALUE('EFG')
RTVDTAARA DTAARA((MYLIB/DA1) (5 5)) RTNVAR(&CLVAR1)

The variable &CLVAR1 now contains 'EFG I'.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]