Figure 3 ECL program compiler listing
/************************************************************/ /*** Source: CHKOBJNME ***/ /*** Date: 11/18/2007 ***/ /*** Author: Mike Pavlak ***/ /*** Description: Source code segment for CL... ***/ /*** ***/ /************************************************************/ PGM PARM(&OBJNME10 &SUPPESC) /* Copybook for Standard Compile time options... */ /* START INCLUDE SRCMBR(DCLPRC01) SRCFILE(MIKEY/QCLSRC) */ /************************************************************/ /*** Source: SRCB ***/ /*** Date: 11/18/2007 ***/ /*** Author: Mike Pavlak ***/ /*** Description: Source code segment for CL... ***/ /*** ***/ /************************************************************/ DCLPRCOPT LOG(*YES) ALWRTVSRC(*NO) /* END INCLUDE SRCMBR(DCLPRC01) SRCFILE(MIKEY/QCLSRC) */ DCL VAR(&OBJNME10) TYPE(*CHAR) LEN(10) DCL VAR(&SUPPESC) TYPE(*CHAR) LEN(4) /* Copybook for API structure format... */ /* START INCLUDE SRCMBR(VFYN0100) SRCFILE(MIKEY/QCLSRC) */ /************************************************************/ /*** Source: VFYN0100 ***/ /*** Date: 11/18/2007 ***/ /*** Author: Mike Pavlak ***/ /*** Description: Format for the new API for object ***/ /*** name validation... ***/ /************************************************************/ /* VFYN0100 Format */ DCL VAR(&VFYN0100) TYPE(*CHAR) LEN(38) DCL VAR(&LENFIXED) TYPE(*INT) STG(*DEFINED) + DEFVAR(&VFYN0100 1) DCL VAR(&CCSID) TYPE(*INT) STG(*DEFINED) + DEFVAR(&VFYN0100 5) DCL VAR(&NAMETYPE) TYPE(*CHAR) STG(*DEFINED) + LEN(10) DEFVAR(&VFYN0100 9) DCL VAR(&MonoCase) TYPE(*CHAR) LEN(1) STG(*DEFINED) + DEFVAR(&VFYN0100 19) DCL VAR(&Reserved) TYPE(*CHAR) LEN(1) STG(*DEFINED) + DEFVAR(&VFYN0100 20) DCL VAR(&OffToName) TYPE(*INT) STG(*DEFINED) + DEFVAR(&VFYN0100 21) DCL VAR(&LenName) TYPE(*INT) STG(*DEFINED) + DEFVAR(&VFYN0100 25) DCL VAR(&Name) TYPE(*CHAR) LEN(10) STG(*DEFINED) + DEFVAR(&VFYN0100 29) /* END INCLUDE SRCMBR(VFYN0100) SRCFILE(MIKEY/QCLSRC) */ DCL VAR(&ERROR) TYPE(*CHAR) LEN(4) VALUE(X'00000000') /* Set up structure values... */ CHGVAR VAR(&LENFIXED) VALUE(28) CHGVAR VAR(&CCSID) VALUE(0) /* 0 = Uses Job */ CHGVAR VAR(&NAMETYPE) VALUE('*NAME') CHGVAR VAR(&MONOCASE) VALUE('1') CHGVAR VAR(&RESERVED) VALUE(X'00') CHGVAR VAR(&OffToName) VALUE(28) CHGVAR VAR(&LenName) VALUE(10) /* Max 256 */ CHGVAR VAR(&Name) VALUE(&OBJNME10) /* Max 256 Chars */ /* Invoke the API... */ IF COND(&SUPPESC = *NO) THEN(DO CALL PGM(QCAVFYNM) PARM(&VFYN0100 'VFYN0100' &ERROR) ELSE CMD(DO CALL PGM(QCAVFYNM) PARM(&VFYN0100 'VFYN0100' &ERROR) MONMSG MSGID(CPF019D) EXEC(DO) SNDPGMMSG MSG('Bad name') CHGVAR VAR(&OBJNME10) VALUE('Bad Name ') ENDDO ENDDO END: ENDPGM