Convert Case
Here is a sample of converting one paramter to lowercase using the
current CCSID of the requesting job. The one value that would need
changing is &DATASIZE and the LEN() of &PARM1 -- these two must match
and represent the size of the variable to lowercase.
To handle three input parameters simply vary the second and fourth
parameters being passed to QLGCNVCS (Convert Case).
PGM PARM(&PARM1)
DCL VAR(&PARM1) TYPE(*CHAR) LEN(10)
DCL VAR(&REQCTLBLK) TYPE(*CHAR) LEN(22) +
VALUE(X'00000001000000000000000100000000000+
000000000') /* Use Job CCSID to convert +
input data to lowercase */
/* DCL VAR(&REQCTLBLK) TYPE(*CHAR) LEN(22) +
VALUE(X'00000001000000000000000000000000000+
000000000') */ /* Use Job CCSID to convert +
input data to uppercase */
DCL VAR(&DATASIZE) TYPE(*DEC) LEN(2 0) VALUE(10)
DCL VAR(&DATALEN) TYPE(*CHAR) LEN(4)
CHGVAR %BINARY(&DATALEN) VALUE(&DATASIZE)
CALL PGM(QLGCNVCS) PARM(&REQCTLBLK &PARM1 +
&PARM1 &DATALEN 0)
ENDPGM
Thanks to Bruce Vining
阅读(959) | 评论(0) | 转发(0) |