Figure 2 ECHKOBJNME program

/************************************************************/
/***  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...  */
             INCLUDE    SRCMBR(DCLPRC01)


             DCL        VAR(&OBJNME10) TYPE(*CHAR) LEN(10)
             DCL        VAR(&SUPPESC)  TYPE(*CHAR) LEN(4)


  /* Copybook for API structure format... */
             INCLUDE    SRCMBR(VFYN0100)

             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)
             ENDDO
             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