Common CICS commands

We already know that CICS commands can be written embed in COBOL,PL/I,Assembler or other application programs. The CICS command format for COBOL and PL/I are like this:
COBOL:
EXEC CICS function[option[(arg)]]… END-EXEC
PL/I:
EXEC CICS function[option[(arg)]]… ; (with semicolon at the end)

There are amount of CICS commands. But fortunately only a few of them are commonly used. Below I list the most commonly used ones. Also you may be interested in the whole CICS commond set, see hereor any CICS manual。

EXEC CICS ABEND [ABCODE(arg)]
EXEC CICS ASKTIME [ABSTIME(arg)]
EXEC CICS ASSIGN [OPID(arg)]
EXEC CICS RETURN [TRANSID(arg)]
EXEC CICS HANDLE CONDITION
EXEC CICS IGNORE CONDITION
EXEC CICS READQ TS [QUEUE(arg)]
EXEC CICS WRITEQ TS [QUEUE(arg)]
EXEC CICS DELETEQ TS [QUEUE(arg)]
EXEC CICS RECEIVE MAP
EXEC CICS SEND MAP
EXEC CICS XCTL PROGRAM
EXEC CICS LINK PROGRAM

Run Rexx in JCL

This article will show you how to run a Rexx script by submitting JCL

1、Suppose there is a simplest Rexx scrip named SAYHELLO which can print one line message as below.


EDIT       IBMUSER.REXX.EXEC(SAYHELLO) - 01.00           Member SAYHELLO saved 
Command ===>                                                  Scroll ===> CSR  
****** ***************************** Top of Data ******************************
000001 /******************************REXX*********************************/                
000002 SAY "I WILL PRINT 'HELLO' IN SYSTSPRT BY SUBMITTING JCL"  

  

2、Write a JCL as IBMUSER.TEST.JCL(SAYHELLO):


EDIT       IBMUSER.TEST.JCL(SAYHELLO) - 01.10             Columns 00001 0007
Command ===>                                                  Scroll ===> CSR
****** ***************************** Top of Data ****************************
//IBMUSERS JOB  00000000000392100A01011000010TEST,                    
//  CLASS=3,MSGCLASS=R,NOTIFY=&SYSUID                                 
//STEP01 EXEC PGM=IKJEFT01,REGION=4M                                  
//SYSEXEC  DD DISP=SHR,DSN=IBMUSER.REXX.EXEC /*REXX LIB*/                         
//SYSTSIN  DD *                              /*REXX MEM*/                         
  SAYHELLO                                                            
/*                                                                    
//SYSTSPRT DD SYSOUT=*    

  

3、Submit this JCL. Then type Q;ST to goto SDSF,navigate to your job number, in SYSTSPRT you will of course find job result as below shows


SDSF OUTPUT DISPLAY IBMUSERS J0300135  DSID   102 LINE 0       COLUMNS 02- 81 
 COMMAND INPUT ===>                                            SCROLL ===> CSR 
********************************* TOP OF DATA *********************************
READY                                                                          
  SAYHELLO                                                                     
I WILL PRINT 'HELLO' IN SYSTSPRT BY SUBMITTING JCL                             
READY                                                                          
END                                                                            
******************************** BOTTOM OF DATA *******************************

  

How to capture the result of “FIND ALL” in REXX

Recently I am working for a project where I need to send input to MQ via dataset. All the fields in the dataset are separated by comma ‘,’. I used to count and verify the comma number again and again manually which I soon found it so silly.
Actually this can be simply done by using an ISPF command . You might also be aware of it now. Yeah, the command is
“FIND ‘,’ ALL”

But can this be accomplished by REXX ? If so, I need to know how to capture the result of command “FIND ‘,’ ALL”. Luckily, I found another way out and the code snippet is like this:
Open this macro for edit: IBMUSER.REXX.EXEC(CHECK)

 1  ADDRESS  ISPEXEC
 2  "ISREDIT SEEK ALL ','"
 3  "ISREDIT (COUNT) = SEEK_COUNTS"
 4  SAY "Comma number: "!! COUNT !! "'!'"
 5 EXIT 0  

 

Yeah, as you can see, the result of “FIND ALL” is stores in variable COUNT.
OK, now I can simply open my MQ input dataset and execute this Macro on the command line, and then appears the comma number, which is as expected.
IBMUSER.PROJ.MQ.INPUT