Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 3: CICS Transactions and Commands


Common CICS Commands

You will meet the same handful of CICS commands in almost every program. Master these and you can read most CICS code.

Commands you will use every day

  • SEND MAP / RECEIVE MAP — display a BMS screen and read what the user typed.
  • READ / WRITE / REWRITE / DELETE — read, add, update and delete VSAM records.
  • RETURN — end the task; with TRANSID the transaction restarts on the next keypress.
  • XCTL / LINK — transfer control to another program, or call it and come back.
  • ASSIGN — read system values: user id, terminal id, transaction id, date and time.
  • HANDLE CONDITION — send exceptional conditions (NOTFND, DUPKEY, MAPFAIL) to error paragraphs.
  • WRITEQ TS / READQ TS — keep scratch data in temporary storage queues.

Command quick reference

  • ASKTIME + FORMATTIME — get the current date and time in a usable format.
  • STARTBR / READNEXT / ENDBR — browse through a file record by record.
  • SYNCPOINT — commit a unit of work so file and DB2 updates happen together.
  • ABEND — end the task abnormally with your own abend code (for fatal errors).
  • Keep this cheat-sheet handy while coding:-
    *--- A mini cheat-sheet of everyday commands ---* EXEC CICS SEND MAP('MNTMAP1') MAPSET('MNTSET1') ERASE END-EXEC. EXEC CICS RECEIVE MAP('MNTMAP1') MAPSET('MNTSET1') RESP(WS-R) END-EXEC. EXEC CICS READ FILE('CUSTMAS') INTO(CUST-REC) RIDFLD(CUST-NO) END-EXEC. EXEC CICS RETURN TRANSID('MNT1') COMMAREA(CA-AREA) END-EXEC. EXEC CICS XCTL PROGRAM('INVMENU') END-EXEC. EXEC CICS ASSIGN USERID(WS-USER) TERMINAL(WS-TERM) END-EXEC.





© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant