Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Reply MQ open error Vignesh Sid COBOL Programming 5 Thu Sep 07, 2017 6:02 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us