9.153 PUT_CHAR_AREA
Puts a character string into a character data area.
Arguments
No | Type | Req/ Opt | Description | Min Len | Max Len | Min Dec | Max Dec |
|---|---|---|---|---|---|---|---|
1 | A | Req | Value to put | 1 | 2000 | ||
2 | A | Req | Data area name | 1 | 10 | ||
3 | A | Opt | Library name Default: '*LIBL' | 1 | 10 | ||
4 | A | Opt | Unlock data area 'Y' - unlock data area 'N' - do not unlock data area Default: 'N' | 1 | 1 | ||
5 | N | Opt | Start pos. to insert from. | 1 | 5 | 0 | 0 |
6 | N | Opt | Length to insert | 1 | 4 | 0 | 0 |
Return Values
No return values.
Examples
Store a customer name #CUSNAM in a data area LASTCUST which resides in library QTEMP.
USE BUILTIN(PUT_CHAR_AREA) WITH_ARGS(#CUSNAM LASTCUST QTEMP)
Store a customer name #CUSNAM in bytes 101 to 140 of a data area called INFOCUST which resides in library QTEMP.
USE BUILTIN(PUT_CHAR_AREA) WITH_ARGS(#CUSNAM INFOCUST QTEMP N 101 40)
Store user name in the *LDA data area to be used for report headings.
USE BUILTIN(PUT_CHAR_AREA) WITH_ARGS('''JOHN SMITH''' '''*LDA' '')The first 10 positions of *GDA are updated by the current job. As a group job becomes active it sets a flag in the *GDA.
In other words by retrieving the *GDA you can find out what group jobs you have already activated.
CASE OF_FIELD(#GROUP)
WHEN VALUE_IS('*EQ JOB0001')
USE BUILTIN(PUT_CHAR_AREA) WITH_ARGS('Y' '''*GDA''' '''*LIBL''' 'N' 1 1)
WHEN VALUE_IS('*EQ JOB0002')
USE BUILTIN(PUT_CHAR_AREA) WITH_ARGS('Y' '''*GDA''' '''*LIBL''' 'N' 2 1)
ENDCASE