IBM Support

Simple Usage of the QLGCNVCS API to Convert the Case of the Input Data

Troubleshooting


Problem

CL program that uses the QLGCNVCS API to convert the case of the input data as desired (depending on the case request parameter used).

Resolving The Problem

The following CL program uses the QLGCNVCS API to convert the case of the input data as desired (depending on the case request parameter used).

Note: The CCSID of the data in this case is assumed to be the same as that of the job running the program.

CL source LGCNVCS
            PGM        PARM(&INITVAL)

            DCL        VAR(&INITVAL) TYPE(*CHAR) LEN(5)
            DCL        VAR(&FINALVAL) TYPE(*CHAR) LEN(5)
            DCL        VAR(&FIELDLEN) TYPE(*CHAR) LEN(4) VALUE(X'00000005')
            DCL        VAR(&CASEREQL) TYPE(*CHAR) LEN(22) +
                         VALUE(X'00000001000000000000000100000000000000000000')
            DCL        VAR(&CASEREQU) TYPE(*CHAR) LEN(22) +
                         VALUE(X'00000001000000000000000000000000000000000000')
            DCL        VAR(&ERROR) TYPE(*CHAR) LEN(4) VALUE(X'00000000')
            CALL       PGM(QLGCNVCS) PARM((&CASEREQU) (&INITVAL) (&FINALVAL) (&FIELDLEN) (&ERROR))
            SNDPGMMSG  MSG('Initial value = ' *CAT &INITVAL *CAT ' and Final value = ' *CAT +
                         &FINALVAL)
            ENDPGM     
Compile using 
CRTBNDCL PGM(<yourlib>/LGCNVCS) SRCFILE(<yourlib>/QCLLESRC) SRCMBR(LGCNVCS)

> Call lgcnvcs 'Toshi'                          
  Initial value = Toshi and Final value = TOSHI 



[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m3p000000hB4rAAE","label":"API"},{"code":"a8m3p0000006x8GAAQ","label":"CL"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]

Historical Number

350354612

Document Information

More support for:
IBM i

Component:
API, CL

Software version:
All Versions

Operating system(s):
IBM i

Document number:
638903

Modified date:
07 May 2025

UID

nas8N1015932

Manage My Notification Subscriptions