Search

Saturday, November 17, 2012

MQPUT Through JCL

JCL to LOAD the Data into MQ(Message Queue) channels from a sequential data set.

With CSQUTIL MQPUT can be done in batch.

//MQLOAD1  JOB (ABCDEFGH),'ABCDEFG',
//         MSGCLASS=T,SCHENV=DB2DBJB,
//         NOTIFY=&SYSUID,TIME=90
//*
//MKCMDS   EXEC PGM=CSQUTIL,PARM='Queue Manger Name'
//STEPLIB   DD DSN=MQM.M***.SCSQAUTH,DISP=SHR
//INFILE   DD DISP=SHR,DSN=TEST.RSS.XCI0500.STRGTEST.INPUT
//SYSPRINT DD SYSOUT=*
//CSQUOUT  DD SYSOUT=*
//SYSIN    DD *
LOAD QUEUE ( PK01) DDNAME(INFILE)
/*

JCL to Alter and Define Queues

Commands can be executed in JCL to alter/define MQ

Here I am altering INITQ for Local Queue PK01.

//PRODSTEP EXEC PGM=CSQUTIL,PARM='QueueManger Name'        <===== QMGR ?????
//SYSPRINT DD SYSOUT=* 
//STEPLIB DD DSN=MQM.SCSQLOAD,DISP=SHR 
//SYSIN DD *
COMMAND DDNAME(CMDGET)
/*
//CMDGET DD *
ALTER QLOCAL(PK01) INITQ(CICS1.INITQ)                                 

Friday, November 16, 2012

Delete Messages from Queue through JCL

Messages can be deleted from batch job

The below sample job deletes all the messages from a MQ. CSQUTIL is a utility program which enables to delete message from queue. Only the developer running this should have authority to access queue.

//EMPTY EXEC PGM=CSQUTIL,PARM='AB01'                    <---- Queue Manager
//STEPLIB DD DISP=SHR,DSN=MQM.SCSQANLE
//        DD DISP=SHR,DSN=MQM.SCSQAUTH
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
EMPTY QUEUE(MQTEST_Q)
/

Sunday, November 4, 2012

COBOL z/OS Performance Improvements

COBOL tips for performance improvements

  • Always consider using SEARCH ALL option instead of checking long table by coding.
  • Internal SORT is usually uses longer CPU than External SORT.
  • Always consider using Evaluate, it creates program more modular.
  • Avoid using go to statement as they create irregular flow.

DB2 - Locks

How DB2 locks works?

DB2 Database Manager implicitly acquires locks as they are need, except for occasions where the Uncommitted Read isolation level is used.

It is possible for the DB2 Database Manager to acquire row-level locks or table-level locks on a specific table resource by executing a special form of the ALTER TABLE SQL statement. By default, the DB2 Database Manager always attempts to acquire row-level locks.
  
 The syntax is ALTER TABLE [Table NameLOCKSIZE [ROW | TABLE] 
 E.g. ALTER TABLE school LOCKSIZE TABLE

Saturday, November 3, 2012

COBOL Date Function to get correct offset from GMT

COBOL DATE FUNCTION

There was requirement were we had to send MT202 to Swift. Swift accepts time of GMT or either it accepts with correct offset and when we use current time option in COBOL it gives local time hence we were getting ET time.I had faced issue with time. The offset I was getting was not correct from GMT. 

For E.g.: ET time is 4 hrs offset from GMT when day-light saving is on and it is 5 hrs offset from GMT when day light saving is off.  

I used following function and by using this function we get the offset from GMT of where your application is running, then we can easily just use native COBOL.


See the CURRENT-DATE intrinsic function at: