星期三, 11月 08, 2023

2011-12-22 使用 Delete Object (QLIDLTO) API 刪除物件(Command DLTOBJ)


使用 Delete Object (QLIDLTO) API 刪除物件(Command DLTOBJ)

從 V6R1 後系統提供新 API QLIDLTO 來刪除物件,其功能相當於其他指令 DLTxxxx 的刪除物件指令。

File  : QCLSRC

Member: DLTOBJ

Type  : CLP

Usage : CRTCLPGM yourlib/DLTOBJ
        
OS    : V6R1

/*  ===============================================================  */
/*  = Command DltObjC    CPP                                      =  */
/*  =   DltObjC    CLP                                            =  */
/*  =   Paramater notes:                                          =  */
/*  =     Object   : Object and library names                     =  */
/*  =     Type     : Object type                                  =  */
/*  =     AspDev   : Auxiliary storage pool (ASP) device          =  */
/*  =     RmvMsg   : Remove message                               =  */
/*  =                                                             =  */
/*  = For V6R1 and later use                                      =  */
/*  =                                                             =  */
/*  ===============================================================  */
/*  = Date  : 2012/12/22                                          =  */
/*  = Author: Vengoal Chang                                       =  */
/*  ===============================================================  */

Pgm  (&QualObj &Type &AspDev &RmvMsg)

   Dcl &QualObj *char 20
   Dcl &Type    *char 10
   Dcl &AspDev  *char 10
   Dcl &RmvMsg  *char 1
   Dcl &ApiErr  *char 8    X'0000000000000000'

   Dcl &MsgId   *char 7
   Dcl &MsgDta  *char 256
   Dcl &Msgf    *char 10
   Dcl &MsgfLib *char 10
   Dcl &MsgTxt  *char 256

   MonMsg     MsgId(CPF0000 MCH0000) exec(GoTo Error)

   Call       QLIDLTO ( &QualObj  +
                        &Type     +
                        &AspDev   +
                        &RmvMsg   +
                        &ApiErr   +
                      )

   Return

/*  ===============================================================  */
/*  = Error routine                                               =  */
/*  ===============================================================  */

Error:

  RcvMsg     MsgType( *Excp )                                         +
             MsgDta( &MsgDta )                                        +
             MsgID( &MsgID )                                          +
             MsgF( &MsgF )                                            +
             MsgFLib( &MsgFLib )
  MonMsg     ( CPF0000 MCH0000 )

SndMsg:

  SndPgmMsg  MsgID( &MsgID )                                          +
             MsgF( &MsgFLib/&MsgF )                                   +
             MsgDta( &MsgDta )                                        +
             MsgType( *Escape )
  MonMsg     ( CPF0000 MCH0000 )

/*  ===============================================================  */
/*  = End of program                                              =  */
/*  ===============================================================  */

EndPgm



File  : QCMDSRC

Member: DLTOBJ

Type  : CMD

Usage : CRTCMD Cmd(yourlib/DLTOBJ) Pgm(DltObj) 

OS    : V6R1

/*  ===============================================================  */
/*  = Command....... DltObj                                       =  */
/*  = CPP........... DltObj   CLP                                 =  */
/*  = Description... Delete Object by                             =  */
/*  =                simple object name, a generic object name,   =  */
/*  =                or *ALL                                      =  */
/*  =                                                             =  */
/*  = CrtCmd      Cmd( DltObj )                                   =  */
/*  =             Pgm( DltObj )                                   =  */
/*  =             SrcFile( YourSourceFile )                       =  */
/*  ===============================================================  */
/*  = Date  : 2012/12/22                                          =  */
/*  = Author: Vengoal Chang                                       =  */
/*  ===============================================================  */
             CMD        PROMPT('Delete Object')

             PARM       KWD(OBJ) TYPE(QUAL2) MIN(1) PROMPT('Object')

             PARM       KWD(OBJTYPE) TYPE(*CHAR) LEN(10) MIN(1) +
                        SPCVAL(                       +
                               ( *ALRTBL    )              +
                               ( *AUTL      )              +
                               ( *BNDDIR    )              +
                               ( *CFGL      )              +
                               ( *CHTFMT    )              +
                               ( *CLD       )              +
                               ( *CLS       )              +
                               ( *CMD       )              +
                               ( *CNNL      )              +
                               ( *COSD      )              +
                               ( *CRQD      )              +
                               ( *CSI       )              +
                               ( *CSPMAP    )              +
                               ( *CSPTBL    )              +
                               ( *CTLD      )              +
                               ( *DEVD      )              +
                               ( *DTAARA    )              +
                               ( *DTADCT    )              +
                               ( *DTAQ      )              +
                               ( *EDTD      )              +
                               ( *FCT       )              +
                               ( *FILE      )              +
                               ( *FNTTBL    )              +
                               ( *FNTRSC    )              +
                               ( *FORMDF    )              +
                               ( *FTR       )              +
                               ( *GSS       )              +
                               ( *IGCDCT    )              +
                               ( *IGCSRT    )              +
                               ( *IGCTBL    )              +
                               ( *IMGCLG    )              +
                               ( *IPXD      )              +
                               ( *JOBD      )              +
                               ( *JOBQ      )              +
                               ( *JRN       )              +
                               ( *JRNRCV    )              +
                               ( *LIB       )              +
                               ( *LIND      )              +
                               ( *LOCALE    )              +
                               ( *MEDDFN    )              +
                               ( *MENU      )              +
                               ( *MODD      )              +
                               ( *MODULE    )              +
                               ( *MSGF      )              +
                               ( *MSGQ      )              +
                               ( *MGTCOL    )              +
                               ( *NODL      )              +
                               ( *NODGRP    )              +
                               ( *NTBD      )              +
                               ( *NWID      )              +
                               ( *NWSCFG    )              +
                               ( *NWSD      )              +
                               ( *OUTQ      )              +
                               ( *OVL       )              +
                               ( *PAGDFN    )              +
                               ( *PAGSEG    )              +
                               ( *PDFMAP    )              +
                               ( *PDG       )              +
                               ( *PGM       )              +
                               ( *PNLGRP    )              +
                               ( *PSFCFG    )              +
                               ( *QMFORM    )              +
                               ( *QMQRY     )              +
                               ( *QRYDFN    )              +
                               ( *SBSD      )              +
                               ( *SCHIDX    )              +
                               ( *SQLPKG    )              +
                               ( *SQLUDT    )              +
                               ( *SQLXSR    )              +
                               ( *SRVPGM    )              +
                               ( *SVRSTG    )              +
                               ( *SSND      )              +
                               ( *TBL       )              +
                               ( *TIMZON    )              +
                               ( *USRIDX    )              +
                               ( *USRQ      )              +
                               ( *USRSPC    )              +
                               ( *VLDL      )              +
                               ( *WSCST     ))             +
                          PROMPT('Object type')

             PARM       KWD(ASPDEV) TYPE(*NAME) LEN(10) DFT(*) +
                          SPCVAL((* *N) (*SYSBAS *N) (*CURASPGRP +
                          *N) (*ALLAVL *N)) PROMPT('Auxiliary +
                          storage pool device')

             PARM       KWD(RMVMSG) TYPE(*CHAR) LEN(1)     +
                        RSTD( *YES )                       +
                        DFT( *NO )                         +
                        SPCVAL(( *NO    '0' )              +
                               ( *YES   '1' ))             +
                        PROMPT('Remove message')

 QUAL2:      QUAL       TYPE(*GENERIC) EXPR(*YES)
             QUAL       TYPE(*NAME) DFT(*LIBL) SPCVAL((*LIBL) +
                          (*CURLIB)) EXPR(*YES) PROMPT('Library')



詳細資訊參照:Delete Object (QLIDLTO) API




沒有留言: