DB2 z/OS   DB2 LUW
z/OS CICS VTAM

z/OS Stored Procedures

Home


-- DISPLAY Informationen
CALL SYSPROC.ADMIN_COMMAND_DB2 (
'-DISPLAY DATABASE(DSNDB06) SPACENAM(*) LIMIT(300) '
,   50
,   'TS'   -- BP/DB/TS/IX/THD/UT/GRP/DDFGRP
,   'DSN1'
,   200
,   0
,   0
,   0
,   0
,   0
,   0
,   ''
)
;


-- DISPLAY DDF INFORMATIONEN
CALL SYSPROC.ADMIN_COMMAND_DB2 (
'-DISPLAY DDF DETAIL                               '
,   50
,   'DDF'  -- BP/DB/TS/IX/THD/UT/GRP/DDFGRP
,   'DSN1'
,   200
,   0
,   0
,   0
,   0
,   0
,   0
,   ''
)
;

 CALL SYSPROC.ADMIN_COMMAND_DB2 (
 '-DISPLAY BUFFERPOOL (*)                           '
 ,   50
 ,   'BP'   -- BP/DB/TS/IX/THD/UT/GRP/DDFGRP
 ,   'DSN1'
 ,   200
 ,   0
 ,   0
 ,   0
 ,   0
 ,   0
 ,   0
 ,   ''
 )
 ;

   

-- List Member in a PO Dataset

CALL SYSPROC.ADMIN_DS_LIST(
   'YOUR.PO.DATASET'
,  'Y'
,  'N'
,  1
,  'N'
,  0
,  ''
);


-- ZParm Information
CALL SYSPROC.ADMIN_INFO_SYSPARM(
    'DSN1'
,   0
,   ''
    )
;
;;

-- Host Information
CALL SYSPROC.ADMIN_INFO_HOST(
    1
,   ''
,   0
,   ''
    )
;
;;

-- MEMBER LIST DATASHARING
CALL SYSPROC.ADMIN_INFO_HOST(
    2
,   ''
,   0
,   ''
    )
;
;;


-- SSID Information

CALL SYSPROC.ADMIN_INFO_SSID
(
  ''
, 0
, ''
)

;

--
CALL SYSPROC.ADMIN_INFO_SQL(
   '<USERID>'
 , 'PLAN_TABLE'
 , 'DEFAULT'
 , 'FINANCE%-4907080-4907095'
 , 'Y'
 , 'Y'
 , 'Y'
 , 'Y'
 , 'NONE'
 , 'N'
 , 'R'
 , 'NONE'
 , '11111.000.000'
 , ?
 , ?
)
;




-- SYSLOG AB z/OS 1.12
 CALL SYSPROC.ADMIN_INFO_SYSLOG
       (
   ''                        -- SEARCH_FILTER
  ,'*'                       -- SYSTEM_NAME
  ,''                        -- START_DATE
  ,''                        -- START_TIME
  ,''                        -- END_DATE
  ,''                        -- END_TIME
  ,10                        -- MAX_ENTRIES
  ,''                        -- MSG
       )
 ;


CALL SYSPROC.ADMIN_JOB_FETCH
      (
   ''                               -- USERID
 , ''                               -- PASSWORD
 , 'JOB05501'                       -- JOBID
 ,0                                 -- RC
 ,''                                -- MSG
      )
;

-- QUERY A JOB AB z/OS 1.12
CALL SYSPROC.ADMIN_JOB_QUERY
      (
   ''
 , ''
 , 'JOB05501'
 , 0
 , 0
 , 0
 , 0
 , 0
 , 0
 , ''
      )
:


-- DSN REBIND/BIND/FREE Package Plan
CALL SYSPROC.ADMIN_COMMAND_DSN(
  'REBIND PACKAGE(ACM930_D_MAIN.ACMBBLW.(ACM_0930)) '
 , '')
;

CALL SYSPROC.SY2IFILK
      (
  0
 ,''
 ,''
 ,''
 ,''
 ,''
 ,''
 ,''
 ,''
      )
;

--SQLTERM=;
CALL SYSPROC.SY2IFISP
      (
  0
 ,''
 ,''
 ,''
 ,''
 ,''
 ,''
 ,''
 ,''
      )
;


-- Wie der Name sagt Refresh WLM
CALL SYSPROC.WLM_REFRESH
      (
  'DSN1WLM'
 ,'DSN1'
 ,''
 ,0
      )
;



/* Stored Procedure in REXX um Daten von char nach dezimal zu convertieren c2d  */
/* Beispiel lesen der sysibm.sysutil Daten k├Ânnen Lesbar ausgegeben werden            */


--#SET TERMINATOR #

   SET CURRENT SQLID='.......'#
   SET CURRENT SCHEMA='.......'#
   CREATE PROCEDURE DB2SW.P_DB2C2D
      (IN CMDTEXT VARCHAR(8) FOR BIT DATA CCSID UNICODE ,
       OUT CMDRESULT VARCHAR(20) FOR BIT DATA CCSID UNICODE )
     DYNAMIC RESULT SETS 1
     EXTERNAL NAME 'DB2C2D'
     LANGUAGE REXX  P
     ARAMETER CCSID UNICODE 
     PARAMETER STYLE GENERAL
     NOT DETERMINISTIC  FENCED 
     CALLED ON NULL INPUT 
     READS SQL DATA
     NO PACKAGE PATH 
     NO DBINFO 
     NO COLLID 
     WLM ENVIRONMENT <env4rexx>
     ASUTIME NO LIMIT 
     STAY RESIDENT NO 
     PROGRAM TYPE MAIN
     SECURITY DB2 
     INHERIT SPECIAL REGISTERS
     STOP AFTER SYSTEM DEFAULT FAILURES 
     RUN OPTIONS 'TRAP(ON)'
     COMMIT ON RETURN NO
     #

   COMMIT#


CREATE FUNCTION DB2SW.F_DB2C2D
  (CMDTEXT VARCHAR( 8) FOR BIT DATA CCSID UNICODE)
  RETURNS VARCHAR( 20) FOR BIT DATA CCSID UNICODE
  VERSION V1
  LANGUAGE SQL
  SPECIFIC F_DB2C2D
  PARAMETER CCSID UNICODE
  NOT DETERMINISTIC
  EXTERNAL ACTION
  CALLED ON NULL INPUT
  READS SQL DATA
  WLM ENVIRONMENT FOR DEBUG MODE <env4rexx>
  ASUTIME NO LIMIT
  INHERIT SPECIAL REGISTERS
  DISALLOW DEBUG MODE
  CURRENT DATA NO
  DYNAMICRULES RUN
  APPLICATION ENCODING SCHEME UNICODE
  WITHOUT EXPLAIN
  WITHOUT IMMEDIATE WRITE
  ISOLATION LEVEL CS
  OPTHINT ''
  REOPT NONE
  VALIDATE RUN
  ROUNDING DEC_ROUND_HALF_EVEN
  DECIMAL(15)
  NOT SECURED
  BUSINESS_TIME SENSITIVE YES
  SYSTEM_TIME SENSITIVE YES
  BEGIN
    DECLARE CMDRESULT VARCHAR( 20) FOR BIT DATA CCSID UNICODE ;
    SET CMDRESULT = '' ;
    CALL P_DB2C2D(CMDTEXT, CMDRESULT) ;
    RETURN CMDRESULT ;
  END #

  --#SET TERMINATOR #
  -- Aufruf

  SELECT F_DB2C2D(CAST(X'0011' AS VARCHAR(8) FOR BIT DATA   ))
FROM SYSIBM.SYSDUMMY1
;



Rexx

/* REXX DB2C2D  */
PARSE UPPER ARG FELD
RET_STRING = c2d(FELD) * 1
Exit  RET_STRING