Skip to content
systemcoding.dev
Mainframe

Define Programs and Transactions With CEDA

Use the CEDA transaction to define a CICS program and transaction in a group, install the group into a running region and check it with CEMT.

6 min read
Summarize in AI
Flat illustration of a 3270 terminal showing JCL beside a mainframe.

A compiled program does nothing until CICS has been told that it exists. That telling is done with resource definitions, and the online tool for writing them is the CEDA transaction. This post defines a program and a transaction, installs them into a running CICS Transaction Server for z/OS 6.1 region on z/OS 3.1 and checks that CICS accepted them. It builds on the first CICS program post, where the load module HELLOCIC was compiled and linked, and it explains the three-level structure of groups, lists and the CSD that confuses most newcomers.

What CEDA edits

CEDA is the resource definition online transaction, RDO. It does not touch a running region directly. It edits the CICS system definition data set, the CSD, which is a VSAM file. A definition in the CSD is only a stored description. It becomes real when it is installed into the region, either at startup from a list or on demand with the INSTALL command.

Three levels hold the definitions together.

LevelWhat it isExample
ResourceOne definition: a PROGRAM, TRANSACTION, FILE and so onPROGRAM(HELLOCIC)
GroupA named set of resources that you install togetherMYGRP
ListA named set of groups loaded at a cold or initial startMYLIST

A resource belongs to exactly one group. A group can sit in any number of lists. The system initialization parameter GRPLIST names the list the region installs at startup, so a group that is not in the active list will not be there after a restart even if you installed it by hand today.

Defining the program

Type CEDA on a clear screen and press Enter for the main panel, or give the full command directly.

Text
CEDA DEFINE PROGRAM(HELLOCIC) GROUP(MYGRP)

CICS shows a panel with the attributes of the definition, filled with defaults. The fields that matter first are these.

Text
 OVERTYPE TO MODIFY
 CEDA  DEFine PROGram( HELLOCIC )
   PROGram       ==> HELLOCIC
   Group         ==> MYGRP
   DEscription   ==>
   Language      ==> Cobol
   RELoad        ==> No
   RESident      ==> No
   USAge         ==> Normal
   USElpacopy    ==> No
   Status        ==> Enabled

The exact attribute list varies with your CICS version, and the screen above is a trimmed illustration of the shape, not a literal capture. Set Language to Cobol so CICS knows the calling convention, leave Status as Enabled, and press Enter to save. A message at the top shows DEFINE SUCCESSFUL. For a first program, the defaults for RELoad, RESident and USAge are right. A program defined as RESident stays in storage, which only matters for a heavily used module.

Defining the transaction

The transaction definition ties a four-character ID to the program.

Text
CEDA DEFINE TRANSACTION(HELO) GROUP(MYGRP)

On the panel, set PROGram ==> HELLOCIC. The other attributes can stay at their defaults for now, but know what they are: TWasize is the size of the transaction work area, PROfile names a profile that sets terminal and storage options, with DFHCICST as the default, and TASKDATAKEY and TASKDATALOC control where the task's storage is obtained. Attributes such as SPurge, TPUrge and DTImeout decide whether a stuck task can be purged. Leave them until you understand your region's standards. When you press Enter the panel confirms the define.

Installing the group

The definitions are saved but not active. INSTALL loads a whole group into the running region.

Text
CEDA INSTALL GROUP(MYGRP)

CICS processes each resource and reports at the top of the screen.

Text
 INSTALL SUCCESSFUL

If one resource fails, for example because the program name has a typo in the library, the message names it and the others in the group may still install. Always read the line. A group install that partly worked looks like a success until you run a transaction that was not installed.

For a program that already exists in the region and is in use, the install behaves like a refresh of the definition, and you still need the NEWCOPY step from the later post to pick up a new load module.

Keeping it across a restart

An installed definition lasts until the region ends unless the region performs a warm start with its catalog, which keeps resources that were installed dynamically. For a development region you often rely on that. For a production design, add the group to a list that the region installs at startup.

Text
CEDA ADD GROUP(MYGRP) LIST(MYLIST)

ADD puts the group in the list MYLIST, creating the list if it does not exist. Whether MYLIST is the list the region reads at startup depends on the GRPLIST parameter in the region's setup, which your CICS systems programmer controls. Do not change a production list from a development session without agreement, since the list may install hundreds of groups.

Looking at what you have

Several CEDA commands help you see the definitions.

Text
CEDA EXPAND GROUP(MYGRP)
CEDA VIEW PROGRAM(HELLOCIC) GROUP(MYGRP)
CEDA COPY PROGRAM(HELLOCIC) GROUP(MYGRP) TO(NEWGRP)

EXPAND lists every resource in the group, VIEW shows one definition without allowing edits, and COPY duplicates a definition into another group, which is the usual way to promote a resource. After installing, confirm with the master terminal transaction.

Text
CEMT INQUIRE PROGRAM(HELLOCIC)

The result line shows the program name, its status as Ena for enabled and the use count, which is zero until the first run.

Text
 STATUS:  RESULTS - OVERTYPE TO MODIFY
  Prog(HELLOCIC) Len(0000000000) Cob Ena Pri  Ced

The Ced marker shows the definition came from CEDA rather than from a program autoinstall, and Len is zero because the module has not been loaded yet. The exact layout of this line depends on your release.

The batch alternative

For repeatable builds, use the batch utility DFHCSDUP to apply the same definitions from a script. Deploy scripts that run DEFINE and ADD statements are easier to review and rerun than screen sessions, and the output records what changed.

jcl
//CSDUP   EXEC PGM=DFHCSDUP,PARM='CSD(READWRITE)'
//STEPLIB DD DISP=SHR,DSN=CICSTS61.CICS.SDFHLOAD
//DFHCSD  DD DISP=SHR,DSN=CICSTS61.CICSA.DFHCSD
//SYSPRINT DD SYSOUT=*
//SYSIN   DD *
  DEFINE PROGRAM(HELLOCIC) GROUP(MYGRP) LANGUAGE(COBOL)
  DEFINE TRANSACTION(HELO) GROUP(MYGRP) PROGRAM(HELLOCIC)
  ADD GROUP(MYGRP) LIST(MYLIST)
/*

The CSD data set name is a placeholder. A caution: if a CICS region has the CSD open for update, do not run DFHCSDUP against it without the shared-access setup your site uses, or one of the two will fail on a lock.

Common errors

DEFINE fails with DUPLICATE when the resource name already exists in the group, and the fix is to choose another group or use ALTER. INSTALL fails with a message that a program is in use when tasks are running it. A transaction that responds TRANSACTION NOT FOUND after install usually means the install ran in a different region than the one you are signed on to.

A naming habit that saves trouble

Name groups by application and purpose, not by person or date. A group called ORDGRP that holds the programs, transactions, files and map sets of the order application can be copied, installed and removed as one unit, and nobody has to guess what is in it. Keep a group small enough to install in seconds, and split off long-lived infrastructure such as files into their own group, because you will redefine programs far more often than files.

Share

Keep reading

Get new posts by email

We send one email when a new post is published. No spam.

Unsubscribe in one click. No spam, ever.