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
 

 

Called program should be used for both online and batch

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

New User


Joined: 16 Apr 2008
Posts: 14
Location: Chennai

PostPosted: Wed Feb 24, 2010 10:55 am    Post subject: Called program should be used for both online and batch
Reply with quote

Hi,

I have program which can be called during online process as well as batch process.

During online process it having issues as im opening an output file which is used only for batch activity.

Is there any way to handle only for batch call we should enable the select and FD sections.For onlie it should get disable.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Feb 24, 2010 11:21 am    Post subject:
Reply with quote

Hello,

Change the code so that the problem open/write/close is not executed when the program is run online.
Back to top
View user's profile Send private message
senthil_1983

New User


Joined: 16 Apr 2008
Posts: 14
Location: Chennai

PostPosted: Wed Feb 24, 2010 12:06 pm    Post subject:
Reply with quote

for Open and close i have handled it its online those statement will not execute.

But when i try to execute the program its end up in error as select (file definition)statement is there.

But the select statement is need for Batch execution.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Wed Feb 24, 2010 12:37 pm    Post subject:
Reply with quote

Hi Senthil,

I am not entirely sure on this as i have not done this before nor am i in a position to test the same now...

anyway i suggest that maybe you could use the SELECT OPTIONAL phrase in your subroutine.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Wed Feb 24, 2010 1:09 pm    Post subject: Reply to: Called program should be used for both online and
Reply with quote

Usually for this kind of requirement ( PROGRAM/FUNCTION REUSE ) the batch programs are split in two parts

the MAIN program with all the I/O and environment related stuff

the DATA MANGLING part as an external subroutine with the <business process> only environment clean
and it can be used from any environment
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 Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm


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