Transaction management systems on z/OS
Previous topic | Next topic | Contents | Glossary | Contact z/OS | PDF


CICS programming commands

Transaction management systems on z/OS

The general format of a CICS® command is EXECUTE CICS (or EXEC CICS) followed by the name of the command and possibly one or more options.

You can write many application programs using the CICS command-level interface without any knowledge of, or reference to, the fields in the CICS control blocks and storage areas. However, you might need to get information that is valid outside the local environment of your application program.

When you need a CICS system service, for example when reading a record from a file, you just include a CICS command in your code. In COBOL, for example, CICS commands look like this:
EXEC CICS function option option ... END-EXEC.

The "function" is the action you want to perform. Reading a file is READ, writing to a terminal is SEND, and so on.

An "option" is some specification that's associated with the function. Options are expressed as keywords. For example, the options for the READ command include FILE, RIDFLD, UPDATE, and others. FILE tells CICS which file you want to read, and is always followed by a value indicating or pointing to the file name. RIDFLD (record identification field, that is, the key) tells CICS which record and likewise needs a value. The UPDATE option, on the other hand, simply means that you intend to change the record, and it doesn't take any value. So, to read with intent to modify, a record from a file known to CICS as ACCTFIL, using a key that we stored in working storage as ACCTC, we issued the command shown in Figure 1.
Figure 1. CICS command example
EXEC CICS 
READ FILE('ACCTFIL') 
RIDFLD(ACCTC) UPDATE ... 
END-EXEC.

You can use the ADDRESS and ASSIGN commands to access such information. For programming information about these commands, see CICS Application Programming Reference. When using the ADDRESS and ASSIGN commands, various fields can be read but should not be set or used in any other way. This means that you should not use any of the CICS fields as arguments in CICS commands, because these fields may be altered by the EXEC interface modules.





Copyright IBM Corporation 1990, 2010