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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm


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