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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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