Search

Thursday, February 14, 2013

Submit JCL through REXX

The following REXX tool explains how JCL can be submitted through REXX.

Step 1: To get inputs from the user


/*REXX*/
/* TRACE I */
USERID = SYSVAR('SYSUID')
 "EXEC 'SYS2.CMDPROC(CLRSCRN)' CLIST"
ARG  ID FILEDT SQLINR
SAY  ID
SAY  FILEDT
SAY  SQLINR
IF ID = ' ' THEN
    DO
      SAY 'ENTER ID REQUIRED FOR INQUIRY'
      PULL IDID
    END
IF FILEDT = ' ' THEN
    DO
      SAY 'ENTER FILE DT REQUIRED FOR INQUIRY IN MM/DD/YYYY FORMAT '
      PULL FILEDT
    END
IF SQLINR = ' ' THEN
    DO
      SAY 'ENTER THE REGION FROM WHERE ID IS REQUIRED'
      PULL SQLINR
    END
IF IDID = 'END' | FILEDT = 'END' | SQLINR = 'END' THEN
    DO
      SAY 'COMMAND ENDED. THANK YOU'
      EXIT
    END
   INTLL  = LEFT(USERID(),3)
/* */

Step: 2: To allocate file where JCL will be returned with the user id automatically appended 


  "ALLOC FI(JCLFILE) DA('"USERID()".PABCB.N.TEMP.ABCD') OLD CATALOG  REUSE",
      "SPACE(1,1) TRACKS LRECL(80) BLKSIZE(3120) RECFM(F,B)"

Step 3: To create JCL


   IF ID <> "END" THEN DO
      JCL.1   = "//#ABC"INTLL"C JOB (00011100000"USERID()"),'X',"
      JCL.2   = "//             CLASS=X,"
      JCL.3   = "//             MSGCLASS=0,"
      JCL.4   = "//             REGION=4M,"
      JCL.5   = "//             NOTIFY="USERID()
      JCL.6   = "/*JOBPARM S="ABCV
      JCL.7   = "//*"
      JCL.8   = "//STEP01S  EXEC PGM=IKJEFT01"
      JCL.9   = "//STEPLIB   DD  DSN=DB2E.PSYSB.P.ABCD.SDSNLOAD,DISP=SHR"
      JCL.10  = "//SYSTSPRT  DD  SYSOUT=*"
      JCL.11  = "//DETAILS   DD  SYSOUT=*"
      JCL.12  = "//FREELST   DD  SYSOUT=*"
      JCL.13  = "//SYSTSIN   DD  *"
 JCL.14 = " EXEC 'ISPS.PABCB.P.ABC.EXEC(PVDREQR)' '"ID" "FILEDT" "SQLINR"'"
    END
      "EXECIO * DISKW JCLFILE (STEM JCL. FINIS)"
      "FREE FI(JCLFILE)"

Step 4: To submit JCL


      "SUBMIT '"USERID()".PABCB.N.TEMP.ABCD'"

After this, you can see the JCL in spool by checking the jobname #ABC*






Tuesday, February 12, 2013

Options of CICS DB2 connections

Options of CICS DB2 connections 

There are three main types of threads that can  be used for DB2 CICS connection:

TYPE=COMD
TYPE=POOL
TYPE=ENTRY

COMD is DB2 command thread it is used for only processing DB2 commands through DSNC transaction.  It is not used for CICS attachment facility.

POOL is Pool threads are used for all transactions and commands not using an entry type or a DB2 command type. Pool threads are normally used for: 

  1. Low volume transactions
  2. Overflow transactions  from both COMD and ENTRY type threads 
  3. It is terminated immediately when it is unused

ENTRY is ENtry type thread which is used for: 

  1. High volume transactions 
  2. High priority transactions 
  3. Controlled transactions 

ENTRY type can be defined as protected as well as unprotected.The MVS subtask for an entry thread is not terminated, even if the entry thread is terminated. This is true for both protected and unprotected entry threads. 
Requests for an entry thread can be transferred to the pool, if an entry thread is not available.