View previous topic :: View next topic
|
Author |
Message |
Paul1983
New User
Joined: 08 Jul 2008 Posts: 37 Location: bangy
|
|
|
|
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
DATASET('FILE1')
RIDFLD(WS-KEY)
END-EXEC.
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
Thanks,
Seena |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
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. |
|
Back to top |
|
|
Raghu navaikulam
Active User
Joined: 27 Sep 2008 Posts: 193 Location: chennai
|
|
|
|
Hi Paul1983
Quote: |
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.
Quote: |
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.
Regards
Raghu |
|
Back to top |
|
|
vinit_infy Warnings : 1 New User
Joined: 07 Apr 2005 Posts: 56
|
|
|
|
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. |
|
Back to top |
|
|
|