Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Open the File in Main Pgm, Write the Records in Sub Pgm

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
gokuldass

New User


Joined: 18 Mar 2005
Posts: 48
Location: india

PostPosted: Sat Mar 19, 2005 12:27 am    Post subject: Open the File in Main Pgm, Write the Records in Sub Pgm
Reply with quote

plz help..
i am opened a file in main cobol program.. and i want to write a record to the file in cobol subprogram without opening it and the closing of file has to do it in subprogram..

how to write the Porgram for this.. or how to do it..
Back to top
View user's profile Send private message

mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Mar 19, 2005 9:39 pm    Post subject: Re: Open the File in Main Pgm, Write the Records in Sub Pgm
Reply with quote

Hi Gok,

You'll have to define the file as EXTERNAL. Read the COBOL Language Reference Manual for your compiler version for the full details.
Back to top
View user's profile Send private message
gokuldass

New User


Joined: 18 Mar 2005
Posts: 48
Location: india

PostPosted: Thu Mar 24, 2005 12:20 am    Post subject: hai jack.
Reply with quote

i had given the external but it says that the option is incorrect.
is there any complier option has to give for this.. if so help me to find it
can u give me sample for this....
Back to top
View user's profile Send private message
somasundaran_k

Active User


Joined: 03 Jun 2003
Posts: 134

PostPosted: Thu Mar 24, 2005 12:44 am    Post subject:
Reply with quote

Gouldass
Please note these points while using EXTERNAL clause.

To use external files, you must:

Include the FD and the SELECT clause for the external files in every program in your run unit that accesses those files

Code the EXTERNAL clause in the FD

Declare all Working-Storage items for these files (that you want to be accessible to every program that uses the files) as EXTERNAL .

Also check this link
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igypg205/5.2.7.1?DT=20000925141919#HDRID03165

hth
-Som
Back to top
View user's profile Send private message
gokuldass

New User


Joined: 18 Mar 2005
Posts: 48
Location: india

PostPosted: Mon Mar 27, 2006 10:13 am    Post subject: Re: Open the File in Main Pgm, Write the Records in Sub Pgm
Reply with quote

Thanks all,

I got the solution..

Thx & Regards
Gokul
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us