IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to implement multi-thread processing of a file


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Sat Oct 31, 2015 2:15 pm
Reply with quote

In batch processing, there is a file , with volumes of records in it, and need to be processed by cobol program and then inserted into a table.

If I use only one program to process the file from beginning to end, a lot of time will elapse . And such a long processing time is not acceptable.

so, is there a way to implement this by so called multi-thread processing?
That is , several programs process the file simutaneously, and each program only process specifiled portion of the file.

Thanks for your kind advice in advance.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Oct 31, 2015 3:01 pm
Reply with quote

Of course. Code it. Or split the file and run multiple times.

You're not going to sit down and write something in batch to actually manage the multi-threading, are you?
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Sat Oct 31, 2015 6:51 pm
Reply with quote

Bill Woodger wrote:
Of course. Code it. Or split the file and run multiple times.

You're not going to sit down and write something in batch to actually manage the multi-threading, are you?

Actually, I am the one to design and code this.
Would u please advise some solution on how to code it?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3049
Location: NYC,USA

PostPosted: Tue Nov 03, 2015 3:28 am
Reply with quote

Quote:
In batch processing, there is a file , with volumes of records in it, and need to be processed by cobol program and then inserted into a table.


I would suggest you to create multiple load files and concatenate and then use the load utility to load it instead to make it by a COBOL-DB2 , I don't think anything faster than this.
Back to top
View user's profile Send private message
seagull

New User


Joined: 28 May 2007
Posts: 24
Location: Dublin

PostPosted: Tue Nov 10, 2015 11:26 pm
Reply with quote

What is the structure of the file? VSAM, flat file, something else? Your solution will depend on that.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Wed Nov 11, 2015 12:15 am
Reply with quote

Quote:
need to be processed by cobol program and then inserted into a table
I believe it's Not the same file which is processed and inserted. is it ?

If you are processing a large file in a cobol program and generating an output file to load the table and you are worried about the time taken in processing, then the best way is to split the input file in n number of parts (say 10). Then, run multiple jobs (equal to n) 'concurrently' using the same program but different input files.

This way you'll get multiple output files. Concatenate and Load.

.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3049
Location: NYC,USA

PostPosted: Wed Nov 11, 2015 12:23 am
Reply with quote

RahulG31, We both are on the same page , ain't we?
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Wed Nov 11, 2015 1:23 am
Reply with quote

@Rohit: From the language, it seemed to me that there is a file which needs to be loaded into the table and the same file is used to process and create output records from cobol program (separately). I thought these were 2 separate processes. Sometimes, reading multiple times may give multiple meanings to the same sentence.

I think it was a wrong interpretation by me but if you 'only read the words in bold', you'll know what I mean
Quote:
In batch processing, there is a file , with volumes of records in it, and need to be processed by cobol program and then inserted into a table.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top