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
 

 

Return code of Internal reader job

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

New User


Joined: 29 Dec 2010
Posts: 6
Location: India

PostPosted: Wed Dec 29, 2010 9:22 pm    Post subject: Return code of Internal reader job
Reply with quote

Is there any way to get the return code of a job which was submitted by COBOL program?

I want to get the return code of job to cobol program which just submitted the job through internal reader.


ie: Sending retrun code to the cobol program which submitted the job.

or

Can we instruct a job to use particular register for its return code ( something like Notify in job card)??



Thx- Gkl.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Dec 29, 2010 9:24 pm    Post subject:
Reply with quote

Basically no,
Back to top
View user's profile Send private message
asnagara

New User


Joined: 29 Dec 2010
Posts: 6
Location: India

PostPosted: Wed Dec 29, 2010 9:28 pm    Post subject:
Reply with quote

thanks!

Any more information about register? beyond its usuage to set Return code?

any material about register?

Thx-Gkl.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed Dec 29, 2010 9:28 pm    Post subject:
Reply with quote

Once the job is submitted into the internal reader, depending upon the site, the Workload Manager rules, the run time of the program, and so forth -- it could be seconds to hours to days between the time the job is submitted and the time the job completes. So how do you think you could possibly get a return code of any sort back from that job?
Back to top
View user's profile Send private message
asnagara

New User


Joined: 29 Dec 2010
Posts: 6
Location: India

PostPosted: Wed Dec 29, 2010 9:42 pm    Post subject:
Reply with quote

well, if a cobol pgm is able to move a return code to register, why cant a cobol pgm until a register get a value by cobol program?
Back to top
View user's profile Send private message
asnagara

New User


Joined: 29 Dec 2010
Posts: 6
Location: India

PostPosted: Wed Dec 29, 2010 9:43 pm    Post subject:
Reply with quote

sorry typo


well, if a cobol pgm is able to move a return code to register, why cant a cobol pgm wait until a register get a value by cobol program?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Wed Dec 29, 2010 9:47 pm    Post subject:
Reply with quote

asnagara wrote:
well, if a cobol pgm is able to move a return code to register, why cant a cobol pgm wait until a register get a value by cobol program?

Because you will be tying up an initiator with a job that is doing no processing, but rather waiting idly until the second job is finished.

Why not have the last step of the second job send notification of its status when it completes?
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 Dec 29, 2010 9:59 pm    Post subject:
Reply with quote

Hello,

In addition to wasting resources as Akatsukami mentions, you are adding unneeded complexity. . .

Suggest you re-consider the design to make this process run serially.
Back to top
View user's profile Send private message
asnagara

New User


Joined: 29 Dec 2010
Posts: 6
Location: India

PostPosted: Wed Dec 29, 2010 10:11 pm    Post subject:
Reply with quote

Thanks all!


The problem is

My job has to find status of many batches. Once a status of a batch A is found, cobol pgm will write the status in a card, then the card will be given to another job which will send a email.

Once email is send( ie: RC=0 of the second job) my cobol pgm will start calculating status for batch B.


Note: we can’t assume about number of batches per day. I’m okay with all design related stuffs, but struggling find a way to receive return code from second job.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed Dec 29, 2010 10:11 pm    Post subject:
Reply with quote

Quote:
well, if a cobol pgm is able to move a return code to register, why cant a cobol pgm wait until a register get a value by cobol program?
Because one register is in the address space of the first job, and the other register (entirely unrelated to the first even if they are the same memory location) is in the address space of the second job. While data can be transferred across address spaces, this is a highly complex and very advanced thing to do, well beyond the expertise of most application programmers.

There are other, simple approaches (using a job scheduler, having one job submit another job, etc) that will accomplish such goals without requiring advanced programming or resources being tied up unnecessarily.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Wed Dec 29, 2010 10:31 pm    Post subject:
Reply with quote

Quote:
I’m okay with all design related stuffs


You may need to reconsider this statement.

Why do you care about the return code of the second Job?

If it is just sending email, what could go wrong?

If you get a bad condition code from Job Two, do you want to stop Job One? Why?

Process a Batch
Send an email
Repeat until no more batches

Can the sending of the email be a called subroutine in Job One?

Sometimes discussing the design may improve the process.
Back to top
View user's profile Send private message
asnagara

New User


Joined: 29 Dec 2010
Posts: 6
Location: India

PostPosted: Wed Dec 29, 2010 10:56 pm    Post subject:
Reply with quote

Dave,

Cob pgm will find status of batchA then place them in card, then the card will be used to send an email to sender A, once email job is done successfully, the same card will be used to find batchB, agin email will be ...

all i need is to make the cobol pgm to wait until email job is done and will use the card again.

any help?

Thx-Gkl.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Wed Dec 29, 2010 11:18 pm    Post subject:
Reply with quote

Quote:
all i need is to make the cobol pgm to wait until email job is done and will use the card again.


This is a very poor design. All you need is to CHANGE YOUR DESIGN.

What does the email job look like? What does this 'card' look like?

You may want to consider writing all you email correspondence to a single file (card in your words?), then submit the email job once at the end to send all the emails.

Having a Job wait in the middle (mid program in our case), should never be considered.
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Thu Dec 30, 2010 5:44 am    Post subject:
Reply with quote

Robert Sample wrote:
There are other, simple approaches (using a job scheduler, having one job submit another job, etc) that will accomplish such goals without requiring advanced programming or resources being tied up unnecessarily.

Like Robert says, you should examine if your job scheduler can be used to send notifications for failed jobs, or even issue automatic problem tickets.

Also, some JES log archiving systems (like $AVRS) can parse condition codes and other job info from spool queues and could possibly also be used as source for a notification application.

It is not always feasible or even possible to implement application programs to perform tasks that infrastructure tools are supposed to handle.
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 What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
No new posts DFHWS2LS return value divated CICS 4 Mon Nov 07, 2016 5:44 pm
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Need Help in understanding what is th... mainakdalal PL/I & Assembler 9 Mon Oct 03, 2016 8:03 pm


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