I'm trying to read a VSAM file in a CICS program.As I'm new to CICS, I'm confused as how the connectuon is made in CICS program to a file.
I can see the command as
EXEC CICS STARTBR
and I found in manuals as FILE1 is the dataset name. In a COBOL program you will mention the DD name and through the JCL we will access the file.
Can any one tell me how the same functionality is achieved in a CICS program
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
The file needs to previously be defined to the cics region.
Suggest you talk with your cics system support for how this file is set up and then use the appropriate name in your code. If there is an existing program that uses this same file, you might look at that code and set up your code similarly.
The big difference between what you are used to in batch is that in batch, files are directly allocated by your code. In cics, files are allocated to the cics region.
and I found in manuals as FILE1 is the dataset name.
"FILE1" is not the Dataset name. It is a File name(Max. 8 char). Data set name can be up to 44 characters with separators.
In a COBOL program you will mention the DD name and through the JCL we will access the file.
In COBOL we use an external file name in the SELECT statement that refers to DD name in JCL. In CICS-COBOL program there is no SELECT statement for an external file. This external file is to be defined to the respective CICS region in which the program is going to execute. While defining the file name in CICS region, the dataset name with respect to the file name also must be mentioned. To know more about how to define file in CICS, contact the CICS support or your senior staff.
Just to add -
The file entry should be in FCT (File control table). Where your CICS support staffs define the file's ddname with the dsn name and with all the file attributes. Some time you will have to close/disable the file through cics if the same file is used for write operation in any batch job.