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
 

 

How to read a file in parallel using COBOL program?

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

New User


Joined: 23 May 2008
Posts: 35
Location: beijing China

PostPosted: Thu Mar 28, 2013 9:42 am    Post subject: How to read a file in parallel using COBOL program?
Reply with quote

Hello all,

there is a scenario that need to read a file in parallel with cobol program.

If a file is already be opened and written info into it by one process, just like a system log file, is it possibol to open that file by another cobol batch program in share mode?

I just did a test, the batch job was hanging with a message of waiting for data set.

do you have the same requirement ever before? and does it can be achieved by any workaround?
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Mar 28, 2013 10:29 am    Post subject:
Reply with quote

Hi - What is the access type for file or what kind of file you're referring here?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Thu Mar 28, 2013 2:57 pm    Post subject:
Reply with quote

If the file is a sequential file then the program writing to it should have a DISP of NEW or OLD. Either implies exclusive use so another program cannot SHR. If the file is VSAM, on the other hand, it will depend on the share options specified for the VSAM file.
Back to top
View user's profile Send private message
haohao

New User


Joined: 23 May 2008
Posts: 35
Location: beijing China

PostPosted: Thu Mar 28, 2013 3:39 pm    Post subject:
Reply with quote

thanks a lot for your quick response icon_smile.gif

it doesn't matter use PS file or Vsam file, both are OK.

If use VSAM file, how to set the share optioin?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu Mar 28, 2013 4:40 pm    Post subject:
Reply with quote

You don't -- or at least should not -- determine VSAM file share options based upon a single situation; you must look at how the file is being used by the entire application. Depending upon the site standards and the application and the experience level of the developer, any SHROPTION (2,3) or (3,3) or (4,3) might be appropriate.
Back to top
View user's profile Send private message
haohao

New User


Joined: 23 May 2008
Posts: 35
Location: beijing China

PostPosted: Fri Mar 29, 2013 5:52 am    Post subject:
Reply with quote

OK, thanks a lot Robert, I will first have a test on it
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Mar 29, 2013 10:35 am    Post subject:
Reply with quote

haohao wrote:
it doesn't matter use PS file or Vsam file, both are OK.
icon_confused.gif if so, what you experimented with intially
Quote:
I just did a test, the batch job was hanging with a message of waiting for data set.
Back to top
View user's profile Send private message
haohao

New User


Joined: 23 May 2008
Posts: 35
Location: beijing China

PostPosted: Fri Mar 29, 2013 11:03 am    Post subject:
Reply with quote

I just tested with a PS file, first use edit mode open it in ISPF, and let another batch job open it with DISP=SHR mode. under that circumstance the batch job pending with waiting for data set.
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: Fri Mar 29, 2013 6:51 pm    Post subject:
Reply with quote

Hello,

Yup, exactly as intended. . .
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Fri Mar 29, 2013 7:16 pm    Post subject:
Reply with quote

We have a system in place that lets programs each create their own flat file of messages. Then, at the end of batch, we gather them and copy them into a single file.

This is important for handling problems where a job abends and needs to restart. Any log messages since the last commit need to come out, so we can't share the files.
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 I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 12 Tue Dec 06, 2016 8:30 pm
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
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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