IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

File connection in CICS program


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Paul1983

New User


Joined: 08 Jul 2008
Posts: 37
Location: bangy

PostPosted: Sat May 16, 2009 2:39 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat May 16, 2009 2:52 pm
Reply with quote

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
View user's profile Send private message
Raghu navaikulam

Active User


Joined: 27 Sep 2008
Posts: 193
Location: chennai

PostPosted: Sun May 17, 2009 12:53 am
Reply with quote

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
View user's profile Send private message
vinit_infy
Warnings : 1

New User


Joined: 07 Apr 2005
Posts: 56

PostPosted: Tue May 19, 2009 10:36 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Using API Gateway from CICS program CICS 0
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top