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
 

 

CICS - Execution of JCL using program.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
krunalbafna
Warnings : 1

Active User


Joined: 18 Jan 2010
Posts: 143
Location: Pune

PostPosted: Fri Dec 30, 2011 12:08 pm    Post subject: CICS - Execution of JCL using program.
Reply with quote

Hi,
I am submitting the JCL using SPOOL open,WRITE and CLOSE command using CICS command.

I need to check the return code of the JCL after execution, there may be possibilty that:
1. Input file is empty
2. Input file does not exists.
3. Input file is having different length.
I have to check the status code and send the mail accordingly.

how can we check the job status in CICS program.

Regards,
krunal Bafna
09320145664
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Fri Dec 30, 2011 12:15 pm    Post subject: Reply to: CICS - Execution of JCL using program.
Reply with quote

Quote:
I have to check the status code and send the mail accordingly.

that should be done as a step in the <submitted> job
search the forum for examples

Quote:
how can we check the job status in CICS program.

can not be done
Back to top
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 236

PostPosted: Thu Jan 05, 2012 6:53 pm    Post subject:
Reply with quote

Yes in CICS there is no possibility,but i remember in one of my project there is an piece of code in assembler called as batch monitoring program which would be invoked from CICS and CA7 is scheduled with batch parameters like job name,clas etc, where the Assembler would return the status back to CICS program.Since i am not having knowledge on assembler i skipped to understand the flow... still remains as a black box.
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Sun Jan 08, 2012 9:06 pm    Post subject:
Reply with quote

you need to ask your management to invest in some vendor software that can communicate from batch.

try google search batch to cics
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Mon Jan 09, 2012 11:22 am    Post subject: Reply to: CICS - Execution of JCL using program.
Reply with quote

If your mgmt cannot afford a 3rd party tools or other stuff... one of my idea/approach would be :

1) Write an INSERT query which inserts a row into a DB2 table with the condition code of previous step. Probably, you can differentiate the row inserted by the current user with the other users thru a RACF ID/terminal ID/TIMESTAMPS.

2) Check the same condition code from the DB2 table in your CICS program after a certain amount of time(based on the avg run time statistics of the batch job) and act accordingly in your CICS program based on CC.

Risk: If the batch job executes successfully by taking much more time than the expected avg run time, you might need to validate the START & END timestamps of the batch job and handle accordingly in your CICS program
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Mon Jan 09, 2012 11:31 am    Post subject:
Reply with quote

you might also need to check with your Batch OPS or with implementation team on "How to prepare the JCL(with PRIORITY and other parameters) such that the job should start executing IMMEDIATLY once the CICS program triggers the JCL...?"
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: Mon Jan 09, 2012 8:43 pm    Post subject:
Reply with quote

Hello,

Quote:
1) Write an INSERT query which inserts a row into a DB2 table with the condition code of previous step. Probably, you can differentiate the row inserted by the current user with the other users thru a RACF ID/terminal ID/TIMESTAMPS.
Where you do you suggest CICS get this contidion code?

Quote:
2) Check the same condition code from the DB2 table in your CICS program after a certain amount of time(based on the avg run time statistics of the batch job) and act accordingly in your CICS program based on CC.
So a CICS transaction (most likely several) are to hang around in the system waiting for something to happen in a batch prcesss. . . icon_sad.gif What a waste of resources - and is not permitted in any decent production environment. . .

Quote:
Risk: If the batch job executes successfully by taking much more time than the expected avg run time, you might need to validate the START & END timestamps of the batch job and handle accordingly in your CICS program
Much more than a risk - this would most likely cause the process to fail often.

Quote:
you might also need to check with your Batch OPS or with implementation team on "How to prepare the JCL(with PRIORITY and other parameters) such that the job should start executing IMMEDIATLY once the CICS program triggers the JCL...?"
Better to check with these people as well as the Scheduling people / System support people for a more acceptable solution.

If someone really believes you need to ping-pong between online and batch, the organization should invest in proven software that suppports this.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Mon Jan 09, 2012 9:42 pm    Post subject: Reply to: CICS - Execution of JCL using program.
Reply with quote

why all the back and forth...
just insert as the last step of the jcl the EMAIL step

the topic is shifting towards... how to write a RYO scheduler ,

is going to be locked pretty soon!
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 -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts Asynchronous CICS Processing Question moezbud CICS 0 Mon Mar 06, 2017 6:13 pm
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm


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