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

Why do we need GETMAIN before any file I/O operation


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

New User


Joined: 06 Jun 2005
Posts: 18
Location: mumbai,india

PostPosted: Tue Oct 24, 2006 12:11 pm
Reply with quote

In CICS to update the KSDS file which has 1 record,i am reading the file in read update mode and rewriting it.i am using simple cics command READ-UPDATE and REWRITE.Do i need to perform getmain and freemain for any IO opertion of the file.It is madatory or optional?can anybody tell why do we need GETMAIN before any file I/O operation?

Thanks
Back to top
View user's profile Send private message
meetreks

New User


Joined: 28 Sep 2006
Posts: 26
Location: Edinburgh

PostPosted: Tue Oct 24, 2006 2:18 pm
Reply with quote

Hi,

REad for Update of a VSAM file in CICS locks the record for exclusive use and the only statements we can have after that is a Rewrite or a Release. This however has no direct relation with GETMAIN. GETMAIN allocates resources which you want to use exclusivley, for ex, it can be a chunck of data or any other resource.
Back to top
View user's profile Send private message
gsnvsr

New User


Joined: 06 Jul 2005
Posts: 40

PostPosted: Tue Oct 24, 2006 2:46 pm
Reply with quote

bnsahoo wrote:
In CICS to update the KSDS file which has 1 record,i am reading the file in read update mode and rewriting it.i am using simple cics command READ-UPDATE and REWRITE.Do i need to perform getmain and freemain for any IO opertion of the file.It is madatory or optional?can anybody tell why do we need GETMAIN before any file I/O operation?

Thanks


GETMAIN is used to manually acquire memory if you have a need to pass data exceeding 32k b/n different programs in Linkage. If the data being passed b/n programs is less than 32 k, you can define it under DFHCOMMAREA and CICS will do the memory management for you.
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 FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top