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

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


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
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
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top