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

Extract data from n DB2 Views automaticaly


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
esmeraldo

New User


Joined: 12 Nov 2008
Posts: 3
Location: Brasil

PostPosted: Wed Nov 13, 2019 12:32 am
Reply with quote

Hello guys,

I have a demand that I don't know how to do, and searching the web gave me ideas, but not solutions. I hope you can help.

As I do not know how to solve this, this forum category seems appropriated.

I have a list of DB2 views, that I will get in a Cobol program, on a mainframe environment. I need to run a SELECT * FROM <view>, for each one of this views, and save the result in datasets. But I need them to run at the same time, in separated jobs, for timing purposes. And I need them to run in Control-M.

I don't know how many views there are.

I heard that there is a way to trigger jobs in Control-M from a Cobol program. If so, is there a way to send parameters to those jobs? I thought in having a job with an UNLOAD, but I would need to send symbolics parameters to determine the dataset name with the SQL.

And I thought about using MQSERIES, with each message triggering a job. Can MQSERIES send the message as parameter to the triggered job?

Anyway, does anyone have any ideas of how I can solve this?

Thanks in advance,
Alexandre
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Wed Nov 13, 2019 2:04 am
Reply with quote

This can be used - separate COBOL programs running in parallel jobs, controlled by CONTROL-M, or whatever else.

In order to only unload the views into datasets usually no specific COBOL code is needed (unless there is other specific processing to be done). Standard utilities, like INZUTILB, are able to do unload existing views as well, when invoked from parallel jobs controlled in the same manner.
Back to top
View user's profile Send private message
esmeraldo

New User


Joined: 12 Nov 2008
Posts: 3
Location: Brasil

PostPosted: Wed Nov 13, 2019 7:58 pm
Reply with quote

It can't be done on Cobol, basically for 2 reasons:

1) I don't know how many views will need to run. The user can create a view today, and tomorrow it needs to run. It should be something automatic, and compiling a new program for each new view is not an option.

2) I can't use dynamic SQL in Cobol, as the support team does not allow it.

I already have a tool to extract the data from the Views, reading the SQL from a dataset. I just need to start many jobs with this tool, just choosing the dataset for each one.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Wed Nov 13, 2019 8:10 pm
Reply with quote

esmeraldo wrote:
I already have a tool to extract the data from the Views, reading the SQL from a dataset. I just need to start many jobs with this tool, just choosing the dataset for each one.

How to submit a job from cobol

Can we submit a JCL and get the return code in COBOL?
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Wed Nov 13, 2019 8:40 pm
Reply with quote

P.S.
The topic title - "Extract data from n DB2 Views automatically", as well as the chosen forum - "All Other Mainframe Topics" - are both misleading, because both of them have nothing to do with the issue under question: "How to automatically submit JCL from a COBOL (or any other) code?"
Back to top
View user's profile Send private message
esmeraldo

New User


Joined: 12 Nov 2008
Posts: 3
Location: Brasil

PostPosted: Tue Nov 19, 2019 8:56 pm
Reply with quote

sergeyken wrote:
P.S.
The topic title - "Extract data from n DB2 Views automatically", as well as the chosen forum - "All Other Mainframe Topics" - are both misleading, because both of them have nothing to do with the issue under question: "How to automatically submit JCL from a COBOL (or any other) code?"


It does not need to be a Cobol program submitting a job, it is just one possibility. Another suggestions would be appreciated.

Also, I believe I cannot use INTRDR, as I need to trigger a job in Control-M. Can it do that?

Anyway, support team provided me with an internal solution. Basically, a CICS Cobol program will do the job.

Thanks for all the help! icon_biggrin.gif
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top